diff --git a/activitysim/abm/models/__init__.py b/activitysim/abm/models/__init__.py index 41ddbff18c..40e56acd2f 100644 --- a/activitysim/abm/models/__init__.py +++ b/activitysim/abm/models/__init__.py @@ -24,6 +24,7 @@ non_mandatory_scheduling, non_mandatory_tour_frequency, parking_location_choice, + school_escorting, stop_frequency, summarize, telecommute_frequency, diff --git a/activitysim/abm/models/non_mandatory_destination.py b/activitysim/abm/models/non_mandatory_destination.py index 322d0ed325..adfd4a0982 100644 --- a/activitysim/abm/models/non_mandatory_destination.py +++ b/activitysim/abm/models/non_mandatory_destination.py @@ -7,7 +7,8 @@ from activitysim.core import config, inject, pipeline, simulate, tracing from activitysim.core.util import assign_in_place -from .util import estimation, tour_destination +from .util import estimation, tour_destination, annotate + logger = logging.getLogger(__name__) @@ -43,7 +44,18 @@ def non_mandatory_tour_destination( # choosers are tours - in a sense tours are choosing their destination non_mandatory_tours = tours[tours.tour_category == "non_mandatory"] - # - if no mandatory_tours + # separating out pure escort school tours + # they already have their destination set + if pipeline.is_table("school_escort_tours"): + nm_tour_index = non_mandatory_tours.index + pure_school_escort_tours = non_mandatory_tours[ + (non_mandatory_tours["school_esc_outbound"] == "pure_escort") + | (non_mandatory_tours["school_esc_inbound"] == "pure_escort") + ] + non_mandatory_tours = non_mandatory_tours[ + ~non_mandatory_tours.index.isin(pure_school_escort_tours.index) + ] + if non_mandatory_tours.shape[0] == 0: tracing.no_results(trace_label) return @@ -85,14 +97,27 @@ def non_mandatory_tour_destination( non_mandatory_tours["destination"] = choices_df.choice + # merging back in school escort tours and preserving index + if pipeline.is_table("school_escort_tours"): + non_mandatory_tours = pd.concat( + [pure_school_escort_tours, non_mandatory_tours] + ).set_index(nm_tour_index) + assign_in_place(tours, non_mandatory_tours[["destination"]]) if want_logsums: non_mandatory_tours[logsum_column_name] = choices_df["logsum"] assign_in_place(tours, non_mandatory_tours[[logsum_column_name]]) + assert all( + ~tours["destination"].isna() + ), f"Tours are missing destination: {tours[tours['destination'].isna()]}" + pipeline.replace_table("tours", tours) + if model_settings.get("annotate_tours"): + annotate.annotate_tours(model_settings, trace_label) + if want_sample_table: assert len(save_sample_df.index.get_level_values(0).unique()) == len(choices_df) # save_sample_df.set_index(model_settings['ALT_DEST_COL_NAME'], append=True, inplace=True) diff --git a/activitysim/abm/models/non_mandatory_scheduling.py b/activitysim/abm/models/non_mandatory_scheduling.py index b827f18536..5b32c95501 100644 --- a/activitysim/abm/models/non_mandatory_scheduling.py +++ b/activitysim/abm/models/non_mandatory_scheduling.py @@ -8,10 +8,7 @@ from activitysim.core import timetable as tt from activitysim.core import tracing from activitysim.core.util import assign_in_place - -from .util import estimation from .util.tour_scheduling import run_tour_scheduling -from .util.vectorize_tour_scheduling import vectorize_tour_scheduling logger = logging.getLogger(__name__) DUMP = False diff --git a/activitysim/abm/models/non_mandatory_tour_frequency.py b/activitysim/abm/models/non_mandatory_tour_frequency.py index 813bc7de63..93b36b2f41 100644 --- a/activitysim/abm/models/non_mandatory_tour_frequency.py +++ b/activitysim/abm/models/non_mandatory_tour_frequency.py @@ -17,6 +17,9 @@ from activitysim.core.interaction_simulate import interaction_simulate from .util import estimation +from .util import annotate +from .util.school_escort_tours_trips import recompute_tour_count_statistics + from .util.overlap import person_max_window from .util.tour_frequency import process_non_mandatory_tours @@ -376,6 +379,13 @@ def non_mandatory_tour_frequency(persons, persons_merged, chunk_size, trace_hh_i tracing.register_traceable_table("tours", non_mandatory_tours) pipeline.get_rn_generator().add_channel("tours", non_mandatory_tours) + if pipeline.is_table("school_escort_tours"): + # need to re-compute tour frequency statistics to account for school escort tours + recompute_tour_count_statistics() + + if model_settings.get("annotate_tours"): + annotate.annotate_tours(model_settings, trace_label) + expressions.assign_columns( df=persons, model_settings=model_settings.get("annotate_persons"), diff --git a/activitysim/abm/models/school_escorting.py b/activitysim/abm/models/school_escorting.py new file mode 100644 index 0000000000..1b5a97fc93 --- /dev/null +++ b/activitysim/abm/models/school_escorting.py @@ -0,0 +1,541 @@ +# ActivitySim +# See full license in LICENSE.txt. +import logging + +import numpy as np +import pandas as pd + +from activitysim.core import config, expressions, inject, pipeline, simulate, tracing +from activitysim.core.interaction_simulate import interaction_simulate +from activitysim.core.util import reindex + +from .util import estimation, school_escort_tours_trips + +logger = logging.getLogger(__name__) + +# setting global defaults for max number of escortees and escortees in model +NUM_ESCORTEES = 3 +NUM_CHAPERONES = 2 + + +def determine_escorting_participants(choosers, persons, model_settings): + """ + Determining which persons correspond to chauffer 1..n and escortee 1..n. + Chauffers are those with the highest weight given by: + weight = 100 * person type + 10 * gender + 1*(age > 25) + and escortees are selected youngest to oldest. + """ + global NUM_ESCORTEES + global NUM_CHAPERONES + NUM_ESCORTEES = model_settings.get("NUM_ESCORTEES", NUM_ESCORTEES) + NUM_CHAPERONES = model_settings.get("NUM_CHAPERONES", NUM_CHAPERONES) + + ptype_col = model_settings.get("PERSONTYPE_COLUMN", "ptype") + sex_col = model_settings.get("GENDER_COLUMN", "sex") + age_col = model_settings.get("AGE_COLUMN", "age") + + escortee_age_cutoff = model_settings.get("ESCORTEE_AGE_CUTOFF", 16) + chaperone_age_cutoff = model_settings.get("CHAPERONE_AGE_CUTOFF", 18) + + escortees = persons[ + persons.is_student + & (persons[age_col] < escortee_age_cutoff) + & (persons.cdap_activity == "M") + ] + households_with_escortees = escortees["household_id"] + + # can specify different weights to determine chaperones + persontype_weight = model_settings.get("PERSON_WEIGHT", 100) + gender_weight = model_settings.get("PERSON_WEIGHT", 10) + age_weight = model_settings.get("AGE_WEIGHT", 1) + + # can we move all of these to a config file? + chaperones = persons[ + (persons[age_col] > chaperone_age_cutoff) + & persons.household_id.isin(households_with_escortees) + ] + + chaperones["chaperone_weight"] = ( + (persontype_weight * chaperones[ptype_col]) + + (gender_weight * np.where(chaperones[sex_col] == 1, 1, 2)) + + (age_weight * np.where(chaperones[age_col] > 25, 1, 0)) + ) + + chaperones["chaperone_num"] = ( + chaperones.sort_values("chaperone_weight", ascending=False) + .groupby("household_id") + .cumcount() + + 1 + ) + escortees["escortee_num"] = ( + escortees.sort_values("age", ascending=True).groupby("household_id").cumcount() + + 1 + ) + + participant_columns = [] + for i in range(1, NUM_CHAPERONES + 1): + choosers["chauf_id" + str(i)] = ( + chaperones[chaperones["chaperone_num"] == i] + .reset_index() + .set_index("household_id") + .reindex(choosers.index)["person_id"] + ) + participant_columns.append("chauf_id" + str(i)) + for i in range(1, NUM_ESCORTEES + 1): + choosers["child_id" + str(i)] = ( + escortees[escortees["escortee_num"] == i] + .reset_index() + .set_index("household_id") + .reindex(choosers.index)["person_id"] + ) + participant_columns.append("child_id" + str(i)) + + return choosers, participant_columns + + +def check_alts_consistency(alts): + """ + Checking to ensure that the alternatives file is consistent with + the number of chaperones and escortees set in the model settings. + """ + for i in range(1, NUM_ESCORTEES + 1): + chauf_col = f"chauf{i}" + # The number of chauf columns should equal the number of escortees + assert chauf_col in alts.columns, f"Missing {chauf_col} in alternatives file" + + # Each escortee should be able to be escorted by each chaperone with ride hail or pure escort + assert alts[chauf_col].max() == (NUM_CHAPERONES * 2) + return + + +def add_prev_choices_to_choosers(choosers, choices, alts, stage): + # adding choice details to chooser table + escorting_choice = "school_escorting_" + stage + choosers[escorting_choice] = choices + + stage_alts = alts.copy() + stage_alts.columns = stage_alts.columns + "_" + stage + + choosers = ( + choosers.reset_index() + .merge( + stage_alts, + how="left", + left_on=escorting_choice, + right_on=stage_alts.index.name, + ) + .set_index("household_id") + ) + + return choosers + + +def create_bundle_attributes(row): + """ + Parse a bundle to determine escortee numbers and tour info. + """ + escortee_str = "" + escortee_num_str = "" + school_dests_str = "" + school_starts_str = "" + school_ends_str = "" + school_tour_ids_str = "" + num_escortees = 0 + + for child_num in row["child_order"]: + child_num = str(child_num) + child_id = int(row["bundle_child" + child_num]) + + if child_id > 0: + num_escortees += 1 + school_dest = str(int(row["school_destination_child" + child_num])) + school_start = str(int(row["school_start_child" + child_num])) + school_end = str(int(row["school_end_child" + child_num])) + school_tour_id = str(int(row["school_tour_id_child" + child_num])) + + if escortee_str == "": + escortee_str = str(child_id) + escortee_num_str = str(child_num) + school_dests_str = school_dest + school_starts_str = school_start + school_ends_str = school_end + school_tour_ids_str = school_tour_id + else: + escortee_str = escortee_str + "_" + str(child_id) + escortee_num_str = escortee_num_str + "_" + str(child_num) + school_dests_str = school_dests_str + "_" + school_dest + school_starts_str = school_starts_str + "_" + school_start + school_ends_str = school_ends_str + "_" + school_end + school_tour_ids_str = school_tour_ids_str + "_" + school_tour_id + + row["escortees"] = escortee_str + row["escortee_nums"] = escortee_num_str + row["num_escortees"] = num_escortees + row["school_destinations"] = school_dests_str + row["school_starts"] = school_starts_str + row["school_ends"] = school_ends_str + row["school_tour_ids"] = school_tour_ids_str + return row + + +def create_school_escorting_bundles_table(choosers, tours, stage): + """ + Creates a table that has one row for every school escorting bundle. + Additional calculations are performed to help facilitate tour and + trip creation including escortee order, times, etc. + + Parameters + ---------- + choosers : pd.DataFrame + households pre-processed for the school escorting model + tours : pd.Dataframe + mandatory tours + stage : str + inbound or outbound_cond + + Returns + ------- + bundles : pd.DataFrame + one school escorting bundle per row + """ + # making a table of bundles + choosers = choosers.reset_index() + choosers = choosers.loc[choosers.index.repeat(choosers["nbundles"])] + + bundles = pd.DataFrame() + # bundles.index = choosers.index + bundles["household_id"] = choosers["household_id"] + bundles["home_zone_id"] = choosers["home_zone_id"] + bundles["school_escort_direction"] = ( + "outbound" if "outbound" in stage else "inbound" + ) + bundles["bundle_num"] = bundles.groupby("household_id").cumcount() + 1 + + # initialize values + bundles["chauf_type_num"] = 0 + + # getting bundle school start times and locations + school_tours = tours[(tours.tour_type == "school") & (tours.tour_num == 1)] + + school_starts = school_tours.set_index("person_id").start + school_ends = school_tours.set_index("person_id").end + school_destinations = school_tours.set_index("person_id").destination + school_origins = school_tours.set_index("person_id").origin + school_tour_ids = school_tours.reset_index().set_index("person_id").tour_id + + for child_num in range(1, NUM_ESCORTEES + 1): + i = str(child_num) + bundles["bundle_child" + i] = np.where( + choosers["bundle" + i] == bundles["bundle_num"], + choosers["child_id" + i], + -1, + ) + bundles["chauf_type_num"] = np.where( + (choosers["bundle" + i] == bundles["bundle_num"]), + choosers["chauf" + i], + bundles["chauf_type_num"], + ) + bundles["time_home_to_school" + i] = np.where( + (choosers["bundle" + i] == bundles["bundle_num"]), + choosers["time_home_to_school" + i], + np.NaN, + ) + + bundles["school_destination_child" + i] = reindex( + school_destinations, bundles["bundle_child" + i] + ) + bundles["school_origin_child" + i] = reindex( + school_origins, bundles["bundle_child" + i] + ) + bundles["school_start_child" + i] = reindex( + school_starts, bundles["bundle_child" + i] + ) + bundles["school_end_child" + i] = reindex( + school_ends, bundles["bundle_child" + i] + ) + bundles["school_tour_id_child" + i] = reindex( + school_tour_ids, bundles["bundle_child" + i] + ) + + # each chauffeur option has ride share or pure escort + bundles["chauf_num"] = np.ceil(bundles["chauf_type_num"].div(2)).astype(int) + + # getting bundle chauffeur id based on the chauffeur num + bundles["chauf_id"] = -1 + for i in range(1, NUM_CHAPERONES + 1): + bundles["chauf_id"] = np.where( + bundles["chauf_num"] == i, + choosers["chauf_id" + str(i)], + bundles["chauf_id"], + ) + bundles["chauf_id"] = bundles["chauf_id"].astype(int) + assert ( + bundles["chauf_id"] > 0 + ).all(), "Invalid chauf_id's for school escort bundles!" + + # odd chauf_type_num means ride share, even means pure escort + # this comes from the way the alternatives file is constructed where chauf_id is + # incremented for each possible chauffeur and for each tour type + bundles["escort_type"] = np.where( + bundles["chauf_type_num"].mod(2) == 1, "ride_share", "pure_escort" + ) + + # This is just pulled from the pre-processor. Will break if removed or renamed in pre-processor + # I think this is still a better implmentation than re-calculating here... + school_time_cols = [ + "time_home_to_school" + str(i) for i in range(1, NUM_ESCORTEES + 1) + ] + bundles["outbound_order"] = list(bundles[school_time_cols].values.argsort() + 1) + bundles["inbound_order"] = list( + (-1 * bundles[school_time_cols]).values.argsort() + 1 + ) # inbound gets reverse order + bundles["child_order"] = np.where( + bundles["school_escort_direction"] == "outbound", + bundles["outbound_order"], + bundles["inbound_order"], + ) + + bundles = bundles.apply(lambda row: create_bundle_attributes(row), axis=1) + + # getting chauffer mandatory times + mandatory_escort_tours = tours[ + (tours.tour_category == "mandatory") & (tours.tour_num == 1) + ] + # bundles["first_mand_tour_start_time"] = reindex( + # mandatory_escort_tours.set_index("person_id").start, bundles["chauf_id"] + # ) + # bundles["first_mand_tour_end_time"] = reindex( + # mandatory_escort_tours.set_index("person_id").end, bundles["chauf_id"] + # ) + bundles["first_mand_tour_id"] = reindex( + mandatory_escort_tours.reset_index().set_index("person_id").tour_id, + bundles["chauf_id"], + ) + bundles["first_mand_tour_dest"] = reindex( + mandatory_escort_tours.reset_index().set_index("person_id").destination, + bundles["chauf_id"], + ) + bundles["first_mand_tour_purpose"] = reindex( + mandatory_escort_tours.reset_index().set_index("person_id").tour_type, + bundles["chauf_id"], + ) + + bundles["Alt"] = choosers["Alt"] + bundles["Description"] = choosers["Description"] + + return bundles + + +@inject.step() +def school_escorting( + households, households_merged, persons, tours, chunk_size, trace_hh_id +): + """ + school escorting model + + The school escorting model determines whether children are dropped-off at or + picked-up from school, simultaneously with the driver responsible for + chauffeuring the children, which children are bundled together on half-tours, + and the type of tour (pure escort versus rideshare). + + Run iteratively for an outbound choice, an inbound choice, and an outbound choice + conditional on the inbound choice. The choices for inbound and outbound conditional + are used to create school escort tours and trips. + + Updates / adds the following tables to the pipeline: + + :: + + - households with school escorting choice + - tours including pure school escorting + - school_escort_tours which contains only pure school escort tours + - school_escort_trips + - timetable to avoid joint tours scheduled over school escort tours + + """ + trace_label = "school_escorting_simulate" + model_settings_file_name = "school_escorting.yaml" + model_settings = config.read_model_settings(model_settings_file_name) + + persons = persons.to_frame() + households = households.to_frame() + households_merged = households_merged.to_frame() + tours = tours.to_frame() + + alts = simulate.read_model_alts(model_settings["ALTS"], set_index="Alt") + + households_merged, participant_columns = determine_escorting_participants( + households_merged, persons, model_settings + ) + + check_alts_consistency(alts) + + constants = config.get_model_constants(model_settings) + locals_dict = {} + locals_dict.update(constants) + + school_escorting_stages = ["outbound", "inbound", "outbound_cond"] + escort_bundles = [] + choices = None + for stage_num, stage in enumerate(school_escorting_stages): + stage_trace_label = trace_label + "_" + stage + estimator = estimation.manager.begin_estimation("school_escorting_" + stage) + + model_spec_raw = simulate.read_model_spec( + file_name=model_settings[stage.upper() + "_SPEC"] + ) + coefficients_df = simulate.read_model_coefficients( + file_name=model_settings[stage.upper() + "_COEFFICIENTS"] + ) + model_spec = simulate.eval_coefficients( + model_spec_raw, coefficients_df, estimator + ) + + # allow for skipping sharrow entirely in this model with `sharrow_skip: true` + # or skipping stages selectively with a mapping of the stages to skip + sharrow_skip = model_settings.get("sharrow_skip", False) + stage_sharrow_skip = False # default is false unless set below + if sharrow_skip: + if isinstance(sharrow_skip, dict): + stage_sharrow_skip = sharrow_skip.get(stage.upper(), False) + else: + stage_sharrow_skip = True + if stage_sharrow_skip: + locals_dict["_sharrow_skip"] = True + else: + locals_dict.pop("_sharrow_skip", None) + + # reduce memory by limiting columns if selected columns are supplied + chooser_columns = model_settings.get("SIMULATE_CHOOSER_COLUMNS", None) + if chooser_columns is not None: + chooser_columns = chooser_columns + participant_columns + choosers = households_merged[chooser_columns] + else: + choosers = households_merged + + # add previous data to stage + if stage_num >= 1: + choosers = add_prev_choices_to_choosers( + choosers, choices, alts, school_escorting_stages[stage_num - 1] + ) + + locals_dict.update(coefficients_df) + + logger.info("Running %s with %d households", stage_trace_label, len(choosers)) + + preprocessor_settings = model_settings.get("preprocessor_" + stage, None) + if preprocessor_settings: + expressions.assign_columns( + df=choosers, + model_settings=preprocessor_settings, + locals_dict=locals_dict, + trace_label=stage_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) + + log_alt_losers = config.setting("log_alt_losers", False) + + choices = interaction_simulate( + choosers=choosers, + alternatives=alts, + spec=model_spec, + log_alt_losers=log_alt_losers, + locals_d=locals_dict, + chunk_size=chunk_size, + trace_label=stage_trace_label, + trace_choice_name="school_escorting_" + "stage", + estimator=estimator, + ) + + if estimator: + estimator.write_choices(choices) + choices = estimator.get_survey_values( + choices, "households", "school_escorting_" + stage + ) + estimator.write_override_choices(choices) + estimator.end_estimation() + + # no need to reindex as we used all households + escorting_choice = "school_escorting_" + stage + households[escorting_choice] = choices + + # tracing each step -- outbound, inbound, outbound_cond + tracing.print_summary( + escorting_choice, households[escorting_choice], value_counts=True + ) + + if trace_hh_id: + tracing.trace_df(households, label=escorting_choice, warn_if_empty=True) + + if stage_num >= 1: + choosers["Alt"] = choices + choosers = choosers.join(alts, how="left", on="Alt") + bundles = create_school_escorting_bundles_table( + choosers[choosers["Alt"] > 1], tours, stage + ) + escort_bundles.append(bundles) + + escort_bundles = pd.concat(escort_bundles) + escort_bundles["bundle_id"] = ( + escort_bundles["household_id"] * 10 + + escort_bundles.groupby("household_id").cumcount() + + 1 + ) + escort_bundles.sort_values( + by=["household_id", "school_escort_direction"], + ascending=[True, False], + inplace=True, + ) + + school_escort_tours = school_escort_tours_trips.create_pure_school_escort_tours( + escort_bundles + ) + chauf_tour_id_map = { + v: k for k, v in school_escort_tours["bundle_id"].to_dict().items() + } + escort_bundles["chauf_tour_id"] = np.where( + escort_bundles["escort_type"] == "ride_share", + escort_bundles["first_mand_tour_id"], + escort_bundles["bundle_id"].map(chauf_tour_id_map), + ) + + tours = school_escort_tours_trips.add_pure_escort_tours(tours, school_escort_tours) + tours = school_escort_tours_trips.process_tours_after_escorting_model( + escort_bundles, tours + ) + + school_escort_trips = school_escort_tours_trips.create_school_escort_trips( + escort_bundles + ) + + # update pipeline + pipeline.replace_table("households", households) + pipeline.replace_table("tours", tours) + pipeline.get_rn_generator().drop_channel("tours") + pipeline.get_rn_generator().add_channel("tours", tours) + pipeline.replace_table("escort_bundles", escort_bundles) + # save school escorting tours and trips in pipeline so we can overwrite results from downstream models + pipeline.replace_table("school_escort_tours", school_escort_tours) + pipeline.replace_table("school_escort_trips", school_escort_trips) + + # updating timetable object with pure escort tours so joint tours do not schedule ontop + timetable = inject.get_injectable("timetable") + + # Need to do this such that only one person is in nth_tours + # thus, looping through tour_category and tour_num + # including mandatory tours because their start / end times may have + # changed to match the school escort times + for tour_category in tours.tour_category.unique(): + for tour_num, nth_tours in tours[tours.tour_category == tour_category].groupby( + "tour_num", sort=True + ): + timetable.assign( + window_row_ids=nth_tours["person_id"], tdds=nth_tours["tdd"] + ) + + timetable.replace_table() diff --git a/activitysim/abm/models/stop_frequency.py b/activitysim/abm/models/stop_frequency.py index dd52c0b7a7..94a208075f 100644 --- a/activitysim/abm/models/stop_frequency.py +++ b/activitysim/abm/models/stop_frequency.py @@ -4,6 +4,7 @@ import numpy as np import pandas as pd +from activitysim.abm.models.util import school_escort_tours_trips from activitysim.core import config, expressions, inject, pipeline, simulate, tracing from activitysim.core.util import assign_in_place, reindex @@ -234,3 +235,6 @@ def stop_frequency( slicer="person_id", columns=None, ) + + if pipeline.is_table("school_escort_trips"): + school_escort_tours_trips.merge_school_escort_trips_into_pipeline() diff --git a/activitysim/abm/models/tour_mode_choice.py b/activitysim/abm/models/tour_mode_choice.py index 0dd2a64f54..1e826ae919 100644 --- a/activitysim/abm/models/tour_mode_choice.py +++ b/activitysim/abm/models/tour_mode_choice.py @@ -19,7 +19,7 @@ from activitysim.core.pathbuilder import TransitVirtualPathBuilder from activitysim.core.util import assign_in_place, reindex -from .util import estimation, trip +from .util import estimation, trip, annotate, school_escort_tours_trips from .util.mode import run_tour_mode_choice_simulate logger = logging.getLogger(__name__) @@ -403,17 +403,20 @@ def tour_mode_choice_simulate( all_tours = tours.to_frame() assign_in_place(all_tours, choices_df) + if pipeline.is_table("school_escort_tours") & model_settings.get( + "FORCE_ESCORTEE_CHAUFFEUR_MODE_MATCH", True + ): + all_tours = ( + school_escort_tours_trips.force_escortee_tour_modes_to_match_chauffeur( + all_tours + ) + ) + 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) + annotate.annotate_tours(model_settings, trace_label) if trace_hh_id: tracing.trace_df( diff --git a/activitysim/abm/models/trip_destination.py b/activitysim/abm/models/trip_destination.py index acfc3dafc4..545cfee29f 100644 --- a/activitysim/abm/models/trip_destination.py +++ b/activitysim/abm/models/trip_destination.py @@ -29,6 +29,7 @@ from activitysim.core.util import assign_in_place, reindex from ...core.configuration.base import Any, PydanticBase +from .util.school_escort_tours_trips import split_out_school_escorting_trips from .util import estimation logger = logging.getLogger(__name__) @@ -1387,6 +1388,13 @@ def trip_destination(trips, tours_merged, chunk_size, trace_hh_id): trips_df = trips.to_frame() tours_merged_df = tours_merged.to_frame() + if pipeline.is_table("school_escort_trips"): + school_escort_trips = pipeline.get_table("school_escort_trips") + # separate out school escorting trips to exclude them from the model and estimation data bundle + trips_df, se_trips_df, full_trips_index = split_out_school_escorting_trips( + trips_df, school_escort_trips + ) + estimator = estimation.manager.begin_estimation("trip_destination") if estimator: @@ -1459,6 +1467,23 @@ def trip_destination(trips, tours_merged, chunk_size, trace_hh_id): trips_df.drop(columns="failed", inplace=True, errors="ignore") + if pipeline.is_table("school_escort_trips"): + # setting destination for school escort trips + se_trips_df["destination"] = reindex( + school_escort_trips.destination, se_trips_df.index + ) + # merge trips back together preserving index order + trips_df = pd.concat([trips_df, se_trips_df]) + trips_df["destination"] = trips_df["destination"].astype(int) + trips_df = trips_df.reindex(full_trips_index) + # Origin is previous destination + # (leaving first origin alone as it's already set correctly) + trips_df["origin"] = np.where( + (trips_df["trip_num"] == 1) & (trips_df["outbound"] == True), + trips_df["origin"], + trips_df.groupby("tour_id")["destination"].shift(), + ).astype(int) + pipeline.replace_table("trips", trips_df) if trace_hh_id: diff --git a/activitysim/abm/models/trip_mode_choice.py b/activitysim/abm/models/trip_mode_choice.py index 0fb2bc3818..54586a4483 100644 --- a/activitysim/abm/models/trip_mode_choice.py +++ b/activitysim/abm/models/trip_mode_choice.py @@ -20,7 +20,7 @@ from activitysim.core.pathbuilder import TransitVirtualPathBuilder from activitysim.core.util import assign_in_place -from .util import estimation +from .util import estimation, annotate, school_escort_tours_trips from .util.mode import mode_choice_simulate logger = logging.getLogger(__name__) @@ -281,6 +281,15 @@ def trip_mode_choice(trips, network_los, chunk_size, trace_hh_id): trips_df = trips.to_frame() assign_in_place(trips_df, choices_df) + if pipeline.is_table("school_escort_tours") & model_settings.get( + "FORCE_ESCORTEE_CHAUFFEUR_MODE_MATCH", True + ): + trips_df = ( + school_escort_tours_trips.force_escortee_trip_modes_to_match_chauffeur( + trips_df + ) + ) + tracing.print_summary("trip_modes", trips_merged.tour_mode, value_counts=True) tracing.print_summary( @@ -291,6 +300,9 @@ def trip_mode_choice(trips, network_los, chunk_size, trace_hh_id): pipeline.replace_table("trips", trips_df) + if model_settings.get("annotate_trips"): + annotate.annotate_trips(model_settings, trace_label) + if trace_hh_id: tracing.trace_df( trips_df, diff --git a/activitysim/abm/models/trip_purpose.py b/activitysim/abm/models/trip_purpose.py index 0e74382d82..1e48444e73 100644 --- a/activitysim/abm/models/trip_purpose.py +++ b/activitysim/abm/models/trip_purpose.py @@ -1,7 +1,6 @@ # ActivitySim # See full license in LICENSE.txt. import logging - import numpy as np import pandas as pd @@ -17,6 +16,8 @@ ) from .util import estimation +from activitysim.core.util import reindex +from .util.school_escort_tours_trips import split_out_school_escorting_trips logger = logging.getLogger(__name__) @@ -263,6 +264,13 @@ def trip_purpose(trips, chunk_size, trace_hh_id): trips_df = trips.to_frame() + if pipeline.is_table("school_escort_trips"): + school_escort_trips = pipeline.get_table("school_escort_trips") + # separate out school escorting trips to exclude them from the model and estimation data bundle + trips_df, se_trips_df, full_trips_index = split_out_school_escorting_trips( + trips_df, school_escort_trips + ) + estimator = estimation.manager.begin_estimation("trip_purpose") if estimator: chooser_cols_for_estimation = [ @@ -291,6 +299,13 @@ def trip_purpose(trips, chunk_size, trace_hh_id): trips_df["purpose"] = choices + if pipeline.is_table("school_escort_trips"): + # setting purpose for school escort trips + se_trips_df["purpose"] = reindex(school_escort_trips.purpose, se_trips_df.index) + # merge trips back together preserving index order + trips_df = pd.concat([trips_df, se_trips_df]) + trips_df = trips_df.reindex(full_trips_index) + # we should have assigned a purpose to all trips assert not trips_df.purpose.isnull().any() diff --git a/activitysim/abm/models/trip_scheduling.py b/activitysim/abm/models/trip_scheduling.py index a594f5e0bd..f8345650d8 100644 --- a/activitysim/abm/models/trip_scheduling.py +++ b/activitysim/abm/models/trip_scheduling.py @@ -11,6 +11,7 @@ from activitysim.core import chunk, config, inject, logit, pipeline, tracing from activitysim.core.util import reindex +from .util.school_escort_tours_trips import split_out_school_escorting_trips from .util import probabilistic_scheduling as ps logger = logging.getLogger(__name__) @@ -405,6 +406,14 @@ def trip_scheduling(trips, tours, chunk_size, trace_hh_id): trips_df = trips.to_frame() tours = tours.to_frame() + if pipeline.is_table("school_escort_trips"): + school_escort_trips = pipeline.get_table("school_escort_trips") + # separate out school escorting trips to exclude them from the model and estimation data bundle + trips_df, se_trips_df, full_trips_index = split_out_school_escorting_trips( + trips_df, school_escort_trips + ) + non_se_trips_df = trips_df + # add columns 'tour_hour', 'earliest', 'latest' to trips set_tour_hour(trips_df, tours) @@ -500,6 +509,13 @@ def trip_scheduling(trips, tours, chunk_size, trace_hh_id): trips_df = trips.to_frame() + if pipeline.is_table("school_escort_trips"): + # separate out school escorting trips to exclude them from the model and estimation data bundle + trips_df, se_trips_df, full_trips_index = split_out_school_escorting_trips( + trips_df, school_escort_trips + ) + non_se_trips_df = trips_df + choices = pd.concat(choices_list) choices = choices.reindex(trips_df.index) @@ -530,6 +546,20 @@ def trip_scheduling(trips, tours, chunk_size, trace_hh_id): trips_df["depart"] = choices + if pipeline.is_table("school_escort_trips"): + # setting destination for school escort trips + se_trips_df["depart"] = reindex(school_escort_trips.depart, se_trips_df.index) + non_se_trips_df["depart"] = reindex(trips_df.depart, non_se_trips_df.index) + # merge trips back together + full_trips_df = pd.concat([non_se_trips_df, se_trips_df]) + full_trips_df["depart"] = full_trips_df["depart"].astype(int) + # want to preserve the original order, but first need to remove trips that were dropped + new_full_trips_index = full_trips_index[ + full_trips_index.isin(trips_df.index) + | full_trips_index.isin(se_trips_df.index) + ] + trips_df = full_trips_df.reindex(new_full_trips_index) + assert not trips_df.depart.isnull().any() pipeline.replace_table("trips", trips_df) diff --git a/activitysim/abm/models/util/annotate.py b/activitysim/abm/models/util/annotate.py new file mode 100644 index 0000000000..a7ef4f54c8 --- /dev/null +++ b/activitysim/abm/models/util/annotate.py @@ -0,0 +1,51 @@ +# ActivitySim +# See full license in LICENSE.txt. +import pandas as pd +import logging + +from activitysim.core import expressions +from activitysim.core import tracing +from activitysim.core import inject +from activitysim.core import pipeline + +""" +Code for annotating tables +""" + +logger = logging.getLogger(__name__) + + +def annotate_tours(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 annotate_trips(model_settings, trace_label): + """ + Add columns to the trips table in the pipeline according to spec. + + Parameters + ---------- + model_settings : dict + trace_label : str + """ + trips = inject.get_table("trips").to_frame() + expressions.assign_columns( + df=trips, + model_settings=model_settings.get("annotate_trips"), + trace_label=tracing.extend_trace_label(trace_label, "annotate_trips"), + ) + pipeline.replace_table("trips", trips) diff --git a/activitysim/abm/models/util/canonical_ids.py b/activitysim/abm/models/util/canonical_ids.py index 9eb06c9261..4e46e26aae 100644 --- a/activitysim/abm/models/util/canonical_ids.py +++ b/activitysim/abm/models/util/canonical_ids.py @@ -5,8 +5,11 @@ import numpy as np import pandas as pd +import re -from activitysim.core import config, simulate +from activitysim.core import config +from activitysim.core import pipeline +from activitysim.core import simulate logger = logging.getLogger(__name__) @@ -249,7 +252,6 @@ def canonical_tours(): non_mandatory_tour_flavors = determine_flavors_from_alts_file( nm_alts, provided_nm_tour_flavors, default_nm_tour_flavors, max_extension ) - # FIXME additional non-mandatory tour flavors are added in school escorting PR non_mandatory_channels = enumerate_tour_types(non_mandatory_tour_flavors) logger.info(f"Non-Mandatory tour flavors used are {non_mandatory_tour_flavors}") @@ -320,12 +322,29 @@ def canonical_tours(): + joint_tour_channels ) + # ---- school escort channels + # only include if model is run + if pipeline.is_table("school_escort_tours") | ( + "school_escorting" in config.setting("models", default=[]) + ): + se_model_settings_file_name = "school_escorting.yaml" + se_model_settings = config.read_model_settings(se_model_settings_file_name) + num_escortees = se_model_settings.get("NUM_ESCORTEES", 3) + school_escort_flavors = {"escort": 2 * num_escortees} + school_escort_channels = enumerate_tour_types(school_escort_flavors) + school_escort_channels = ["se_%s" % c for c in school_escort_channels] + logger.info(f"School escort tour flavors used are {school_escort_flavors}") + + sub_channels = sub_channels + school_escort_channels + sub_channels.sort() return sub_channels -def set_tour_index(tours, parent_tour_num_col=None, is_joint=False): +def set_tour_index( + tours, parent_tour_num_col=None, is_joint=False, is_school_escorting=False +): """ The new index values are stable based on the person_id, tour_type, and tour_num. The existing index is ignored and replaced. @@ -367,6 +386,9 @@ def set_tour_index(tours, parent_tour_num_col=None, is_joint=False): if is_joint: tours["tour_id"] = "j_" + tours["tour_id"] + if is_school_escorting: + tours["tour_id"] = "se_" + tours["tour_id"] + # map recognized strings to ints tours.tour_id = tours.tour_id.replace( to_replace=possible_tours, value=list(range(possible_tours_count)) @@ -377,9 +399,16 @@ def set_tour_index(tours, parent_tour_num_col=None, is_joint=False): tours.tour_id = (tours.person_id * possible_tours_count) + tours.tour_id - # if tours.tour_id.duplicated().any(): - # print("\ntours.tour_id not unique\n%s" % tours[tours.tour_id.duplicated(keep=False)]) - # print(tours[tours.tour_id.duplicated(keep=False)][['survey_tour_id', 'tour_type', 'tour_category']]) + if tours.tour_id.duplicated().any(): + print( + "\ntours.tour_id not unique\n%s" + % tours[tours.tour_id.duplicated(keep=False)] + ) + print( + tours[tours.tour_id.duplicated(keep=False)][ + ["survey_tour_id", "tour_type", "tour_category"] + ] + ) assert not tours.tour_id.duplicated().any() tours.set_index("tour_id", inplace=True, verify_integrity=True) @@ -403,9 +432,8 @@ def determine_max_trips_per_leg(default_max_trips_per_leg=4): for c in alts.columns if all(alts[c].astype(str).str.isnumeric()) ] - max_trips_per_leg = ( - max(trips_per_leg) + 1 - ) # adding one for additional trip home or to primary dest + # adding one for additional trip home or to primary dest + max_trips_per_leg = max(trips_per_leg) + 1 if max_trips_per_leg > 1: valid_max_trips = True except (ValueError, RuntimeError): @@ -429,7 +457,7 @@ def set_trip_index(trips, tour_id_column="tour_id"): # = stops + 1 for primary half-tour destination max_trips_per_leg = determine_max_trips_per_leg() - # canonical_trip_num: 1st trip out = 1, 2nd trip out = 2, 1st in = max_trips_per_leg + 1, etc. + # canonical_trip_num: 1st trip out = 1, 2nd trip out = 2, 1st in = 5, etc. canonical_trip_num = (~trips.outbound * max_trips_per_leg) + trips.trip_num trips["trip_id"] = ( trips[tour_id_column] * (2 * max_trips_per_leg) + canonical_trip_num diff --git a/activitysim/abm/models/util/school_escort_tours_trips.py b/activitysim/abm/models/util/school_escort_tours_trips.py new file mode 100644 index 0000000000..778fb86454 --- /dev/null +++ b/activitysim/abm/models/util/school_escort_tours_trips.py @@ -0,0 +1,689 @@ +import logging +import pandas as pd +import numpy as np +import warnings + +from activitysim.abm.models.util import canonical_ids +from activitysim.core import pipeline +from activitysim.core import inject +from activitysim.core.util import reindex + +from ..school_escorting import NUM_ESCORTEES + +logger = logging.getLogger(__name__) + + +def determine_chauf_outbound_flag(row, i): + if row["school_escort_direction"] == "outbound": + outbound = True + elif ( + (row["school_escort_direction"] == "inbound") + & (i == 0) + & (row["escort_type"] == "pure_escort") + ): + # chauf is going to pick up the first child + outbound = True + else: + # chauf is inbound and has already picked up a child or taken their mandatory tour + outbound = False + return outbound + + +def create_chauf_trip_table(row): + dropoff = True if row["school_escort_direction"] == "outbound" else False + + row["person_id"] = row["chauf_id"] + row["destination"] = row["school_destinations"].split("_") + + participants = [] + school_escort_trip_num = [] + outbound = [] + purposes = [] + + for i, child_id in enumerate(row["escortees"].split("_")): + if dropoff: + # have the remaining children in car + participants.append("_".join(row["escortees"].split("_")[i:])) + else: + # remaining children not yet in car + participants.append("_".join(row["escortees"].split("_")[: i + 1])) + school_escort_trip_num.append(i + 1) + outbound.append(determine_chauf_outbound_flag(row, i)) + purposes.append("escort") + + if not dropoff: + # adding trip home + outbound.append(False) + school_escort_trip_num.append(i + 2) + purposes.append("home") + row["destination"].append(row["home_zone_id"]) + # kids aren't in car until after they are picked up, inserting empty car for first trip + participants = [""] + participants + + if dropoff & (row["escort_type"] == "ride_share"): + # adding trip to work + outbound.append(True) + school_escort_trip_num.append(i + 2) + purposes.append(row["first_mand_tour_purpose"]) + row["destination"].append(row["first_mand_tour_dest"]) + # kids have already been dropped off + participants = participants + [""] + + row["escort_participants"] = participants + row["school_escort_trip_num"] = school_escort_trip_num + row["outbound"] = outbound + row["purpose"] = purposes + return row + + +def create_chauf_escort_trips(bundles): + + chauf_trip_bundles = bundles.apply(lambda row: create_chauf_trip_table(row), axis=1) + chauf_trip_bundles["tour_id"] = bundles["chauf_tour_id"].astype(int) + + # departure time is the first school start in the outbound school_escort_direction and the last school end in the inbound school_escort_direction + starts = ( + chauf_trip_bundles["school_starts"].str.split("_", expand=True).astype(float) + ) + ends = chauf_trip_bundles["school_ends"].str.split("_", expand=True).astype(float) + chauf_trip_bundles["depart"] = np.where( + chauf_trip_bundles["school_escort_direction"] == "outbound", + starts.min(axis=1), + ends.max(axis=1), + ) + + # create a new trip for each escortee destination + chauf_trips = chauf_trip_bundles.explode( + [ + "destination", + "escort_participants", + "school_escort_trip_num", + "outbound", + "purpose", + ] + ).reset_index() + + # numbering trips such that outbound escorting trips must come first and inbound trips must come last + outbound_trip_num = -1 * ( + chauf_trips.groupby(["tour_id", "outbound"]).cumcount(ascending=False) + 1 + ) + inbound_trip_num = 100 + chauf_trips.groupby(["tour_id", "outbound"]).cumcount( + ascending=True + ) + chauf_trips["trip_num"] = np.where( + chauf_trips.outbound == True, outbound_trip_num, inbound_trip_num + ) + + # --- determining trip origin + # origin is previous destination + chauf_trips["origin"] = chauf_trips.groupby("tour_id")["destination"].shift() + # outbound trips start at home + first_outbound_trips = (chauf_trips["outbound"] == True) & ( + chauf_trips["school_escort_trip_num"] == 1 + ) + chauf_trips.loc[first_outbound_trips, "origin"] = chauf_trips.loc[ + first_outbound_trips, "home_zone_id" + ] + # inbound school escort ride sharing trips start at work + first_rs_inb = ( + (chauf_trips["outbound"] == False) + & (chauf_trips["school_escort_trip_num"] == 1) + & (chauf_trips["escort_type"] == "ride_share") + ) + chauf_trips.loc[first_rs_inb, "origin"] = chauf_trips.loc[ + first_rs_inb, "first_mand_tour_dest" + ] + + assert all( + ~chauf_trips["origin"].isna() + ), f"Missing trip origins for {chauf_trips[chauf_trips['origin'].isna()]}" + + chauf_trips["primary_purpose"] = np.where( + chauf_trips["escort_type"] == "pure_escort", + "escort", + chauf_trips["first_mand_tour_purpose"], + ) + assert all( + ~chauf_trips["primary_purpose"].isna() + ), f"Missing tour purpose for {chauf_trips[chauf_trips['primary_purpose'].isna()]}" + + chauf_trips.loc[ + chauf_trips["purpose"] == "home", "trip_num" + ] = 999 # trips home are always last + chauf_trips.sort_values( + by=["household_id", "tour_id", "outbound", "trip_num"], + ascending=[True, True, False, True], + inplace=True, + ) + + return chauf_trips + + +def create_child_escorting_stops(row, escortee_num): + escortees = row["escortees"].split("_") + if escortee_num > (len(escortees) - 1): + # this bundle does not have this many escortees + return row + dropoff = True if row["school_escort_direction"] == "outbound" else False + + row["person_id"] = int(escortees[escortee_num]) + row["tour_id"] = row["school_tour_ids"].split("_")[escortee_num] + school_dests = row["school_destinations"].split("_") + + destinations = [] + purposes = [] + participants = [] + school_escort_trip_num = [] + + escortee_order = ( + escortees[: escortee_num + 1] if dropoff else escortees[escortee_num:] + ) + + # for i, child_id in enumerate(escortees[:escortee_num+1]): + for i, child_id in enumerate(escortee_order): + is_last_stop = i == len(escortee_order) - 1 + + if dropoff: + # dropping childen off + # children in car are the child and the children after + participants.append("_".join(escortees[i:])) + dest = school_dests[i] + purpose = "school" if row["person_id"] == int(child_id) else "escort" + + else: + # picking children up + # children in car are the child and those already picked up + participants.append("_".join(escortees[: escortee_num + i + 1])) + # going home if last stop, otherwise to next school destination + dest = ( + row["home_zone_id"] + if is_last_stop + else school_dests[escortee_num + i + 1] + ) + purpose = "home" if is_last_stop else "escort" + + # filling arrays + destinations.append(dest) + school_escort_trip_num.append(i + 1) + purposes.append(purpose) + + row["escort_participants"] = participants + row["school_escort_trip_num"] = school_escort_trip_num + row["purpose"] = purposes + row["destination"] = destinations + return row + + +def create_escortee_trips(bundles): + + escortee_trips = [] + for escortee_num in range(0, int(bundles.num_escortees.max()) + 1): + escortee_bundles = bundles.apply( + lambda row: create_child_escorting_stops(row, escortee_num), axis=1 + ) + escortee_trips.append(escortee_bundles) + + escortee_trips = pd.concat(escortee_trips) + escortee_trips = escortee_trips[~escortee_trips.person_id.isna()] + + # departure time is the first school start in the outbound direction and the last school end in the inbound direction + starts = escortee_trips["school_starts"].str.split("_", expand=True).astype(float) + ends = escortee_trips["school_ends"].str.split("_", expand=True).astype(float) + escortee_trips["outbound"] = np.where( + escortee_trips["school_escort_direction"] == "outbound", True, False + ) + escortee_trips["depart"] = np.where( + escortee_trips["school_escort_direction"] == "outbound", + starts.min(axis=1), + ends.max(axis=1), + ).astype(int) + escortee_trips["primary_purpose"] = "school" + + # create a new trip for each escortee destination + escortee_trips = escortee_trips.explode( + ["destination", "escort_participants", "school_escort_trip_num", "purpose"] + ).reset_index() + + # numbering trips such that outbound escorting trips must come first and inbound trips must come last + # this comes in handy when merging trips to others in the tour decided downstream + outbound_trip_num = -1 * ( + escortee_trips.groupby(["tour_id", "outbound"]).cumcount(ascending=False) + 1 + ) + inbound_trip_num = 100 + escortee_trips.groupby(["tour_id", "outbound"]).cumcount( + ascending=True + ) + escortee_trips["trip_num"] = np.where( + escortee_trips.outbound == True, outbound_trip_num, inbound_trip_num + ) + escortee_trips["trip_count"] = escortee_trips["trip_num"] + escortee_trips.groupby( + ["tour_id", "outbound"] + ).trip_num.transform("count") + + id_cols = ["household_id", "person_id", "tour_id"] + escortee_trips[id_cols] = escortee_trips[id_cols].astype("int64") + + escortee_trips.loc[ + escortee_trips["purpose"] == "home", "trip_num" + ] = 999 # trips home are always last + escortee_trips.sort_values( + by=["household_id", "tour_id", "outbound", "trip_num"], + ascending=[True, True, False, True], + inplace=True, + ) + escortee_trips["origin"] = escortee_trips.groupby("tour_id")["destination"].shift() + # first trips on tour start from home (except for atwork subtours, but school escorting doesn't happen on those tours) + escortee_trips["origin"] = np.where( + escortee_trips["origin"].isna(), + escortee_trips["home_zone_id"], + escortee_trips["origin"], + ) + + return escortee_trips + + +def create_school_escort_trips(escort_bundles): + chauf_trips = create_chauf_escort_trips(escort_bundles) + escortee_trips = create_escortee_trips(escort_bundles) + school_escort_trips = pd.concat([chauf_trips, escortee_trips], axis=0) + + # Can't assign a true trip id yet because they are numbered based on the number of stops in each direction. + # This isn't decided until after the stop frequency model runs. + # Creating this temporary school_escort_trip_id column to match them downstream + school_escort_trips["school_escort_trip_id"] = ( + school_escort_trips["tour_id"].astype("int64") * 10 + + school_escort_trips.groupby("tour_id")["trip_num"].cumcount() + ) + + return school_escort_trips + + +def add_pure_escort_tours(tours, school_escort_tours): + missing_cols = [ + col for col in tours.columns if col not in school_escort_tours.columns + ] + assert ( + len(missing_cols) == 0 + ), f"missing columns {missing_cols} in school_escort_tours" + if len(missing_cols) > 0: + logger.warning(f"Columns {missing_cols} are missing from school escort tours") + school_escort_tours[missing_cols] = pd.NA + + tours_to_add = school_escort_tours[~school_escort_tours.index.isin(tours.index)] + tours = pd.concat([tours, tours_to_add[tours.columns]]) + + return tours + + +def add_school_escorting_type_to_tours_table(escort_bundles, tours): + school_tour = (tours.tour_type == "school") & (tours.tour_num == 1) + + for school_escort_direction in ["outbound", "inbound"]: + for escort_type in ["ride_share", "pure_escort"]: + bundles = escort_bundles[ + (escort_bundles.school_escort_direction == school_escort_direction) + & (escort_bundles.escort_type == escort_type) + ] + # Setting for child school tours + for child_num in range(1, NUM_ESCORTEES + 1): + i = str(child_num) + filter = school_tour & tours["person_id"].isin( + bundles["bundle_child" + i] + ) + tours.loc[filter, "school_esc_" + school_escort_direction] = escort_type + + tours.loc[ + bundles.chauf_tour_id, "school_esc_" + school_escort_direction + ] = escort_type + + return tours + + +def process_tours_after_escorting_model(escort_bundles, tours): + # adding indicators to tours that include school escorting + tours = add_school_escorting_type_to_tours_table(escort_bundles, tours) + + # setting number of escortees on tour + num_escortees = escort_bundles.drop_duplicates("chauf_tour_id").set_index( + "chauf_tour_id" + )["num_escortees"] + tours.loc[num_escortees.index, "num_escortees"] = num_escortees + + # set same start / end time for tours if they are bundled together + tour_segment_id_cols = [ + "school_tour_id_child" + str(i) for i in range(1, NUM_ESCORTEES + 1) + ] + ["chauf_tour_id"] + + for id_col in tour_segment_id_cols: + out_segment_bundles = escort_bundles[ + (escort_bundles[id_col] > 1) + & (escort_bundles.school_escort_direction == "outbound") + ].set_index(id_col) + starts = ( + out_segment_bundles["school_starts"].str.split("_").str[0].astype(int) + ) # first start + tours.loc[starts.index, "start"] = starts + + inb_segment_bundles = escort_bundles[ + (escort_bundles[id_col] > 1) + & (escort_bundles.school_escort_direction == "inbound") + ].set_index(id_col) + ends = ( + inb_segment_bundles["school_ends"].str.split("_").str[-1].astype(int) + ) # last end + tours.loc[ends.index, "end"] = ends + + bad_end_times = tours["start"] > tours["end"] + tours.loc[bad_end_times, "end"] = tours.loc[bad_end_times, "start"] + + # updating tdd to match start and end times + tdd_alts = inject.get_injectable("tdd_alts") + tdd_alts["tdd"] = tdd_alts.index + tours.drop(columns="tdd", inplace=True) + + tours["tdd"] = pd.merge( + tours.reset_index(), tdd_alts, how="left", on=["start", "end"] + ).set_index("tour_id")["tdd"] + # since this is an injectable, we want to leave it how we found it + # not removing tdd created here will caues problems downstream + tdd_alts.drop(columns="tdd", inplace=True) + + assert all( + ~tours.tdd.isna() + ), f"Tours have missing tdd values: {tours[tours.tdd.isna()][['tour_type', 'start', 'end', 'tdd']]}" + + return tours + + +def merge_school_escort_trips_into_pipeline(): + school_escort_trips = pipeline.get_table("school_escort_trips") + tours = pipeline.get_table("tours") + trips = pipeline.get_table("trips") + + # want to remove stops if school escorting takes place on that half tour so we can replace them with the actual stops + out_se_tours = tours[ + tours["school_esc_outbound"].isin(["pure_escort", "ride_share"]) + ] + inb_se_tours = tours[ + tours["school_esc_inbound"].isin(["pure_escort", "ride_share"]) + ] + # removing outbound stops + trips = trips[ + ~(trips.tour_id.isin(out_se_tours.index) & (trips["outbound"] == True)) + ] + # removing inbound stops + trips = trips[ + ~(trips.tour_id.isin(inb_se_tours.index) & (trips["outbound"] == False)) + ] + + # don't want to double count the non-escort half-tour of chauffeurs doing pure escort + inb_chauf_pe_tours = tours[ + (tours["school_esc_inbound"] == "pure_escort") + & (tours.primary_purpose == "escort") + ] + out_chauf_pe_tours = tours[ + (tours["school_esc_outbound"] == "pure_escort") + & (tours.primary_purpose == "escort") + ] + school_escort_trips = school_escort_trips[ + ~( + school_escort_trips.tour_id.isin(inb_chauf_pe_tours.index) + & (school_escort_trips["outbound"] == True) + ) + ] + school_escort_trips = school_escort_trips[ + ~( + school_escort_trips.tour_id.isin(out_chauf_pe_tours.index) + & (school_escort_trips["outbound"] == False) + ) + ] + + # for better merge with trips created in stop frequency + school_escort_trips["failed"] = False + + trips = pd.concat( + [ + trips, + school_escort_trips[ + list(trips.columns) + + [ + "escort_participants", + "school_escort_direction", + "school_escort_trip_id", + ] + ], + ] + ) + # sorting by escorting order as determined when creating the school escort trips + trips.sort_values( + by=["household_id", "tour_id", "outbound", "trip_num"], + ascending=[True, True, False, True], + inplace=True, + ) + grouped = trips.groupby(["tour_id", "outbound"]) + trips["trip_num"] = trips.groupby(["tour_id", "outbound"]).cumcount() + 1 + trips["trip_count"] = trips["trip_num"] + grouped.cumcount(ascending=False) + + # ensuring data types + trips["outbound"] = trips["outbound"].astype(bool) + trips["origin"] = trips["origin"].astype(int) + trips["destination"] = trips["destination"].astype(int) + + # updating trip_id now that we have all trips + trips = canonical_ids.set_trip_index(trips) + school_escort_trip_id_map = { + v: k + for k, v in trips.loc[ + ~trips["school_escort_trip_id"].isna(), "school_escort_trip_id" + ] + .to_dict() + .items() + } + + school_escort_trips["trip_id"] = np.where( + school_escort_trips["school_escort_trip_id"].isin( + school_escort_trip_id_map.keys() + ), + school_escort_trips["school_escort_trip_id"].map(school_escort_trip_id_map), + school_escort_trips["school_escort_trip_id"], + ) + school_escort_trips.set_index("trip_id", inplace=True) + + # can drop school_escort_trip_id column now since it has been replaced + trips.drop(columns="school_escort_trip_id", inplace=True) + + # replace trip table and pipeline and register with the random number generator + pipeline.replace_table("trips", trips) + pipeline.get_rn_generator().drop_channel("trips") + pipeline.get_rn_generator().add_channel("trips", trips) + pipeline.replace_table("school_escort_trips", school_escort_trips) + + # updating stop frequency in tours tabel to be consistent + num_outbound_stops = ( + trips[trips.outbound == True].groupby("tour_id")["trip_num"].count() - 1 + ) + num_inbound_stops = ( + trips[trips.outbound == False].groupby("tour_id")["trip_num"].count() - 1 + ) + stop_freq = ( + num_outbound_stops.astype(str) + "out_" + num_inbound_stops.astype(str) + "in" + ) + tours.loc[stop_freq.index, "stop_frequency"] = stop_freq + + # no need to reset random number generator since no tours added + pipeline.replace_table("tours", tours) + + return trips + + +def recompute_tour_count_statistics(): + tours = pipeline.get_table("tours") + + grouped = tours.groupby(["person_id", "tour_type"]) + tours["tour_type_num"] = grouped.cumcount() + 1 + tours["tour_type_count"] = tours["tour_type_num"] + grouped.cumcount( + ascending=False + ) + + grouped = tours.groupby("person_id") + tours["tour_num"] = grouped.cumcount() + 1 + tours["tour_count"] = tours["tour_num"] + grouped.cumcount(ascending=False) + + pipeline.replace_table("tours", tours) + + +def create_pure_school_escort_tours(bundles): + # creating home to school tour for chauffers making pure escort tours + # ride share tours are already created since they go off the mandatory tour + pe_tours = bundles[bundles["escort_type"] == "pure_escort"] + + pe_tours["origin"] = pe_tours["home_zone_id"] + # desination is the last dropoff / pickup location + pe_tours["destination"] = ( + pe_tours["school_destinations"].str.split("_").str[-1].astype(int) + ) + # start is the first start time for outbound trips or the last school end time for inbound trips + starts = pe_tours["school_starts"].str.split("_").str[0].astype(int) + ends = pe_tours["school_ends"].str.split("_").str[-1].astype(int) + pe_tours["start"] = np.where( + pe_tours["school_escort_direction"] == "outbound", starts, ends + ) + + # just set end equal to start time -- non-escort half of tour is determined downstream + pe_tours["end"] = pe_tours["start"] + pe_tours["duration"] = pe_tours["end"] - pe_tours["start"] + pe_tours["tdd"] = pd.NA # updated with full tours table + + pe_tours["person_id"] = pe_tours["chauf_id"] + + pe_tours["tour_category"] = "non_mandatory" + pe_tours["number_of_participants"] = 1 + pe_tours["tour_type"] = "escort" + pe_tours["school_esc_outbound"] = np.where( + pe_tours["school_escort_direction"] == "outbound", "pure_escort", pd.NA + ) + pe_tours["school_esc_inbound"] = np.where( + pe_tours["school_escort_direction"] == "inbound", "pure_escort", pd.NA + ) + + pe_tours = pe_tours.sort_values(by=["household_id", "person_id", "start"]) + + # finding what the next start time for that person for scheduling + pe_tours["next_pure_escort_start"] = ( + pe_tours.groupby("person_id")["start"].shift(-1).fillna(0) + ) + + grouped = pe_tours.groupby(["person_id", "tour_type"]) + pe_tours["tour_type_num"] = grouped.cumcount() + 1 + pe_tours["tour_type_count"] = pe_tours["tour_type_num"] + grouped.cumcount( + ascending=False + ) + + grouped = pe_tours.groupby("person_id") + pe_tours["tour_num"] = grouped.cumcount() + 1 + pe_tours["tour_count"] = pe_tours["tour_num"] + grouped.cumcount(ascending=False) + + pe_tours = canonical_ids.set_tour_index(pe_tours, is_school_escorting=True) + + return pe_tours + + +def split_out_school_escorting_trips(trips, school_escort_trips): + # separate out school escorting trips to exclude them from the model + full_trips_index = trips.index + se_trips_mask = trips.index.isin(school_escort_trips.index) + se_trips = trips[se_trips_mask] + trips = trips[~se_trips_mask] + + return trips, se_trips, full_trips_index + + +def force_escortee_tour_modes_to_match_chauffeur(tours): + # FIXME: escortee tour can have different chauffeur in outbound vs inbound direction + # which tour mode should it be set to? Currently it's whatever comes last. + # Does it even matter if trip modes are getting matched later? + escort_bundles = inject.get_table("escort_bundles").to_frame() + + # grabbing the school tour ids for each school escort bundle + se_tours = escort_bundles[["school_tour_ids", "chauf_tour_id"]].copy() + # merging in chauffeur tour mode + se_tours["tour_mode"] = reindex(tours.tour_mode, se_tours.chauf_tour_id) + # creating entry for each escort school tour + se_tours["school_tour_ids"] = se_tours.school_tour_ids.str.split("_") + se_tours = se_tours.explode(["school_tour_ids"]) + # create mapping between school tour id and chauffeur tour mode + se_tours["school_tour_ids"] = se_tours["school_tour_ids"].astype("int64") + mode_mapping = se_tours.set_index("school_tour_ids")["tour_mode"] + + # setting escortee tours to have the same tour mode as chauffeur + original_modes = tours["tour_mode"].copy() + tours.loc[mode_mapping.index, "tour_mode"] = mode_mapping + diff = tours["tour_mode"] != original_modes + logger.info( + f"Changed {diff.sum()} tour modes of school escortees to match their chauffeur" + ) + + assert ( + ~tours.tour_mode.isna() + ).all(), f"Missing tour mode for {tours[tours.tour_mode.isna()]}" + return tours + + +def force_escortee_trip_modes_to_match_chauffeur(trips): + school_escort_trips = inject.get_table("school_escort_trips").to_frame() + + # starting with only trips that are created as part of the school escorting model + se_trips = trips[trips.index.isin(school_escort_trips.index)].copy() + + # getting chauffeur tour id + se_trips["chauf_tour_id"] = reindex( + school_escort_trips.chauf_tour_id, se_trips.index + ) + # merging chauffeur trips onto escortee trips + se_trips = ( + se_trips.reset_index() + .merge( + se_trips[ + [ + "origin", + "destination", + "depart", + "escort_participants", + "chauf_tour_id", + "trip_mode", + ] + ], + how="left", + left_on=[ + "origin", + "destination", + "depart", + "escort_participants", + "tour_id", + ], + right_on=[ + "origin", + "destination", + "depart", + "escort_participants", + "chauf_tour_id", + ], + suffixes=("", "_chauf"), + ) + .set_index("trip_id") + ) + # trip_mode_chauf is na if the trip belongs to a chauffeur instead of an escortee + # only want to change mode for escortees + mode_mapping = se_trips[~se_trips["trip_mode_chauf"].isna()]["trip_mode_chauf"] + + # setting escortee trips to have the same trip mode as chauffeur + original_modes = trips["trip_mode"].copy() + trips.loc[mode_mapping.index, "trip_mode"] = mode_mapping + diff = trips["trip_mode"] != original_modes + logger.info( + f"Changed {diff.sum()} trip modes of school escortees to match their chauffeur" + ) + + assert ( + ~trips.trip_mode.isna() + ).all(), f"Missing trip mode for {trips[trips.trip_mode.isna()]}" + return trips diff --git a/activitysim/abm/models/util/test/test_non_mandatory_tour_frequency.py b/activitysim/abm/models/util/test/test_non_mandatory_tour_frequency.py index 5ae895630f..b7fac80442 100644 --- a/activitysim/abm/models/util/test/test_non_mandatory_tour_frequency.py +++ b/activitysim/abm/models/util/test/test_non_mandatory_tour_frequency.py @@ -8,9 +8,18 @@ import pandas.testing as pdt import pytest +from activitysim.core import inject + from ..tour_frequency import process_non_mandatory_tours +def setup_function(): + configs_dir = os.path.join(os.path.dirname(__file__), "configs") + inject.add_injectable("configs_dir", configs_dir) + output_dir = os.path.join(os.path.dirname(__file__), "output") + inject.add_injectable("output_dir", output_dir) + + def test_nmtf(): persons = pd.DataFrame( diff --git a/activitysim/abm/models/util/trip.py b/activitysim/abm/models/util/trip.py index a137934f5f..870801e276 100644 --- a/activitysim/abm/models/util/trip.py +++ b/activitysim/abm/models/util/trip.py @@ -84,6 +84,14 @@ def cleanup_failed_trips(trips): assign_in_place(trips, patch_trips[["trip_num", "trip_count"]]) + # origin needs to match the previous destination + # (leaving first origin alone as it's already set correctly) + trips["origin"] = np.where( + (trips["trip_num"] == 1) & (trips["outbound"] == True), + trips["origin"], + trips.groupby("tour_id")["destination"].shift(), + ).astype(int) + del trips["patch"] del trips["failed"] diff --git a/activitysim/core/config.py b/activitysim/core/config.py index 949d33757d..4bc72b0ec4 100644 --- a/activitysim/core/config.py +++ b/activitysim/core/config.py @@ -711,6 +711,16 @@ def filter_warnings(): "To retain the old behavior, use either.*" ), ) + # beginning in pandas version 1.5, a warning is emitted when using pandas.concat on dataframes + # that contain object-dtype columns with all-bool values. ActivitySim plans to address dtypes + # and move away from object-dtype columns anyhow, so this is not a critical problem. + warnings.filterwarnings( + "ignore", + category=FutureWarning, + message=( + ".*object-dtype columns with all-bool values will not be included in reductions.*" + ), + ) # beginning in sharrow version 2.5, a CacheMissWarning is emitted when a sharrow # flow cannot be loaded from cache and needs to be compiled. These are performance diff --git a/activitysim/core/interaction_simulate.py b/activitysim/core/interaction_simulate.py index 379f8aa6c4..38075e5ad0 100644 --- a/activitysim/core/interaction_simulate.py +++ b/activitysim/core/interaction_simulate.py @@ -670,6 +670,9 @@ def _interaction_simulate( sharrow_enabled = config.setting("sharrow", False) interaction_utilities = None + if locals_d is not None and locals_d.get("_sharrow_skip", False): + sharrow_enabled = False + if ( sharrow_enabled and skims is None diff --git a/activitysim/core/simulate.py b/activitysim/core/simulate.py index 5aa681f3ef..6c0fb902d9 100644 --- a/activitysim/core/simulate.py +++ b/activitysim/core/simulate.py @@ -674,12 +674,6 @@ def eval_utilities( ) timelogger.mark("trace", True, logger, trace_label) - del expression_values - chunk.log_df(trace_label, "expression_values", None) - - # no longer our problem - but our caller should re-log this... - chunk.log_df(trace_label, "utilities", None) - if sharrow_enabled == "test": try: np.testing.assert_allclose( @@ -703,6 +697,16 @@ def eval_utilities( ) print(f"{sh_util.shape=}") print(misses) + _sh_flow_load = sh_flow.load() + print("possible problematic expressions:") + for expr_n, expr in enumerate(exprs): + closeness = np.isclose( + _sh_flow_load[:, expr_n], expression_values[expr_n, :] + ) + if not closeness.all(): + print( + f" {closeness.sum()/closeness.size:05.1%} [{expr_n:03d}] {expr}" + ) raise except TypeError as err: print(err) @@ -712,6 +716,12 @@ def eval_utilities( print(utilities) timelogger.mark("sharrow test", True, logger, trace_label) + del expression_values + chunk.log_df(trace_label, "expression_values", None) + + # no longer our problem - but our caller should re-log this... + chunk.log_df(trace_label, "utilities", None) + end_time = time.time() logger.info( f"simulate.eval_utils runtime: {timedelta(seconds=end_time - start_time)} {trace_label}" diff --git a/activitysim/core/tracing.py b/activitysim/core/tracing.py index bf7ae75a84..fa159d5f95 100644 --- a/activitysim/core/tracing.py +++ b/activitysim/core/tracing.py @@ -764,6 +764,9 @@ def interaction_trace_rows(interaction_df, choosers, sample_size=None): if choosers.index.name == "person_id" and "persons" in traceable_table_ids: slicer_column_name = choosers.index.name targets = traceable_table_ids["persons"] + elif choosers.index.name == "household_id" and "households" in traceable_table_ids: + slicer_column_name = choosers.index.name + targets = traceable_table_ids["households"] elif "household_id" in choosers.columns and "households" in traceable_table_ids: slicer_column_name = "household_id" targets = traceable_table_ids["households"] diff --git a/activitysim/examples/placeholder_psrc/configs/atwork_subtour_frequency.csv b/activitysim/examples/placeholder_psrc/configs/atwork_subtour_frequency.csv index 06e9f8878f..eb5c0658a0 100755 --- a/activitysim/examples/placeholder_psrc/configs/atwork_subtour_frequency.csv +++ b/activitysim/examples/placeholder_psrc/configs/atwork_subtour_frequency.csv @@ -4,7 +4,7 @@ util_dummy_for_non_full_time_worker,pemploy!=1,coefficient_dummy_for_non_full_ti util_dummy_for_non_workers,"ptype in [4, 5]",coefficient_dummy_for_non_workers_no_subtours,coefficient_dummy_for_non_workers_eat,coefficient_dummy_for_non_workers_business1,coefficient_dummy_for_non_workers_maint,coefficient_dummy_for_non_workers_business2,coefficient_dummy_for_non_workers_eat_business util_medium_hh_income_dummy,income_segment == 2,coefficient_medium_hh_income_dummy_no_subtours,coefficient_medium_hh_income_dummy_eat,coefficient_medium_hh_income_dummy_business1,coefficient_medium_hh_income_dummy_maint,coefficient_medium_hh_income_dummy_business2,coefficient_medium_hh_income_dummy_eat_business util_high_hh_income_dummy,(income_segment > 2) & (income_segment < 5),coefficient_high_hh_income_dummy_no_subtours,coefficient_high_hh_income_dummy_eat,coefficient_high_hh_income_dummy_business1,coefficient_high_hh_income_dummy_maint,coefficient_high_hh_income_dummy_business2,coefficient_high_hh_income_dummy_eat_business -util_zero_cars_owned_by_hh_dummy, auto_ownership == 0,coefficient_zero_cars_owned_by_hh_dummy_no_subtours,coefficient_zero_cars_owned_by_hh_dummy_eat,coefficient_zero_cars_owned_by_hh_dummy_business1,coefficient_zero_cars_owned_by_hh_dummy_maint,coefficient_zero_cars_owned_by_hh_dummy_business2,coefficient_zero_cars_owned_by_hh_dummy_eat_business +util_zero_cars_owned_by_hh_dummy,auto_ownership == 0,coefficient_zero_cars_owned_by_hh_dummy_no_subtours,coefficient_zero_cars_owned_by_hh_dummy_eat,coefficient_zero_cars_owned_by_hh_dummy_business1,coefficient_zero_cars_owned_by_hh_dummy_maint,coefficient_zero_cars_owned_by_hh_dummy_business2,coefficient_zero_cars_owned_by_hh_dummy_eat_business util_individual_discretionary_tours_made_by_full_time_worker,@(df.pemploy==1)*df.num_discr_tours,coefficient_individual_discretionary_tours_made_by_full_time_worker_no_subtours,coefficient_individual_discretionary_tours_made_by_full_time_worker_eat,coefficient_individual_discretionary_tours_made_by_full_time_worker_business1,coefficient_individual_discretionary_tours_made_by_full_time_worker_maint,coefficient_individual_discretionary_tours_made_by_full_time_worker_business2,coefficient_individual_discretionary_tours_made_by_full_time_worker_eat_business util_individual_discretionary_tours_made_by_part_time_worker,@(df.pemploy==2)*df.num_discr_tours,coefficient_individual_discretionary_tours_made_by_part_time_worker_no_subtours,coefficient_individual_discretionary_tours_made_by_part_time_worker_eat,coefficient_individual_discretionary_tours_made_by_part_time_worker_business1,coefficient_individual_discretionary_tours_made_by_part_time_worker_maint,coefficient_individual_discretionary_tours_made_by_part_time_worker_business2,coefficient_individual_discretionary_tours_made_by_part_time_worker_eat_business util_individual_eating_out_tours_made_by_person,num_eatout_tours,coefficient_individual_eating_out_tours_made_by_person_no_subtours,coefficient_individual_eating_out_tours_made_by_person_eat,coefficient_individual_eating_out_tours_made_by_person_business1,coefficient_individual_eating_out_tours_made_by_person_maint,coefficient_individual_eating_out_tours_made_by_person_business2,coefficient_individual_eating_out_tours_made_by_person_eat_business diff --git a/activitysim/examples/placeholder_sandag/configs_3_zone/tour_mode_choice.csv b/activitysim/examples/placeholder_sandag/configs_3_zone/tour_mode_choice.csv index 609454d2ec..920c21625a 100644 --- a/activitysim/examples/placeholder_sandag/configs_3_zone/tour_mode_choice.csv +++ b/activitysim/examples/placeholder_sandag/configs_3_zone/tour_mode_choice.csv @@ -187,3 +187,6 @@ util_Walk_not_available_for_long_distances,Walk not available for long distances util_Bike_not_available_for_long_distances,Bike not available for long distances,@df.distance_bike_od > 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,,, +#, School Escorting eligibility,,,,,,,,,,,,,,,,,,,,,, +util_one_or_more_school_escort,No SOV if on school escort tour,"@(df.get('num_escortees', 0) >= 1)",-999,-999,,,,,,,,,,, +util_two_or_more_school_escort,Can't take HOV2 if taking two children and yourself,"@(df.get('num_escortees', 0) >= 2)",,,-999,-999,,,,,,,,, \ No newline at end of file diff --git a/activitysim/examples/placeholder_sandag/configs_3_zone/trip_mode_choice.csv b/activitysim/examples/placeholder_sandag/configs_3_zone/trip_mode_choice.csv index 30952ec5d3..e6bb38fddc 100644 --- a/activitysim/examples/placeholder_sandag/configs_3_zone/trip_mode_choice.csv +++ b/activitysim/examples/placeholder_sandag/configs_3_zone/trip_mode_choice.csv @@ -193,3 +193,6 @@ util_Bike_not_available_for_long_distances,Bike not available for long distances 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 util_walk_express_penalty,Walk-express penalty for intermediate stops,@walk_express_penalty * ~(df.first_trip | df.first_trip),,,,,,,,,,,,, util_adjust_tnc_shared,TNC shared adjustment,@adjust_tnc_shared,,,,,,,,,,,,,coef_ivt +#, School Escorting eligibility,,,,,,,,,,,,,,,,,,,,,, +util_one_or_more_school_escort,No SOV if on school escort tour,(num_escortees >= 1),-999,-999,,,,,,,,,,, +util_two_or_more_school_escort,Can't take HOV2 if taking two children and yourself,(num_escortees >= 2),,,-999,-999,,,,,,,,, \ No newline at end of file diff --git a/activitysim/examples/placeholder_sandag/configs_3_zone/trip_mode_choice_annotate_trips_preprocessor.csv b/activitysim/examples/placeholder_sandag/configs_3_zone/trip_mode_choice_annotate_trips_preprocessor.csv index e07c28f0bb..ea84ab8c81 100644 --- a/activitysim/examples/placeholder_sandag/configs_3_zone/trip_mode_choice_annotate_trips_preprocessor.csv +++ b/activitysim/examples/placeholder_sandag/configs_3_zone/trip_mode_choice_annotate_trips_preprocessor.csv @@ -63,7 +63,7 @@ dest terminal time not counted at home,_dest_terminal_time,"np.where(inbound & l ,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_density,"pd.cut(origin_density_measure.fillna(0), 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 @@ -108,3 +108,5 @@ dest terminal time not counted at home,_dest_terminal_time,"np.where(inbound & l ,distance,od_skims['DIST'] ,distance_walk_od,od_skims['DIST'] ,distance_bike_od,od_skims['DISTBIKE'] +# added for school escorting model,, +Number of school children in vehicle on trip,num_escortees,"0 if 'escort_participants' not in df.columns else df.escort_participants.fillna('').apply(lambda x: len(x.split('_')))" \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc/configs/atwork_subtour_frequency.csv b/activitysim/examples/prototype_mtc/configs/atwork_subtour_frequency.csv index 36b1bf20aa..2a319621e6 100644 --- a/activitysim/examples/prototype_mtc/configs/atwork_subtour_frequency.csv +++ b/activitysim/examples/prototype_mtc/configs/atwork_subtour_frequency.csv @@ -4,7 +4,7 @@ util_dummy_for_non_full_time_worker,pemploy!=1,coefficient_dummy_for_non_full_ti util_dummy_for_non_workers,"ptype in [4, 5]",coefficient_dummy_for_non_workers_no_subtours,coefficient_dummy_for_non_workers_eat,coefficient_dummy_for_non_workers_business1,coefficient_dummy_for_non_workers_maint,coefficient_dummy_for_non_workers_business2,coefficient_dummy_for_non_workers_eat_business util_medium_hh_income_dummy,income_segment == 2,coefficient_medium_hh_income_dummy_no_subtours,coefficient_medium_hh_income_dummy_eat,coefficient_medium_hh_income_dummy_business1,coefficient_medium_hh_income_dummy_maint,coefficient_medium_hh_income_dummy_business2,coefficient_medium_hh_income_dummy_eat_business util_high_hh_income_dummy,(income_segment > 2) & (income_segment < 5),coefficient_high_hh_income_dummy_no_subtours,coefficient_high_hh_income_dummy_eat,coefficient_high_hh_income_dummy_business1,coefficient_high_hh_income_dummy_maint,coefficient_high_hh_income_dummy_business2,coefficient_high_hh_income_dummy_eat_business -util_zero_cars_owned_by_hh_dummy, auto_ownership == 0,coefficient_zero_cars_owned_by_hh_dummy_no_subtours,coefficient_zero_cars_owned_by_hh_dummy_eat,coefficient_zero_cars_owned_by_hh_dummy_business1,coefficient_zero_cars_owned_by_hh_dummy_maint,coefficient_zero_cars_owned_by_hh_dummy_business2,coefficient_zero_cars_owned_by_hh_dummy_eat_business +util_zero_cars_owned_by_hh_dummy,auto_ownership == 0,coefficient_zero_cars_owned_by_hh_dummy_no_subtours,coefficient_zero_cars_owned_by_hh_dummy_eat,coefficient_zero_cars_owned_by_hh_dummy_business1,coefficient_zero_cars_owned_by_hh_dummy_maint,coefficient_zero_cars_owned_by_hh_dummy_business2,coefficient_zero_cars_owned_by_hh_dummy_eat_business util_individual_discretionary_tours_made_by_full_time_worker,@(df.pemploy==1)*df.num_discr_tours,coefficient_individual_discretionary_tours_made_by_full_time_worker_no_subtours,coefficient_individual_discretionary_tours_made_by_full_time_worker_eat,coefficient_individual_discretionary_tours_made_by_full_time_worker_business1,coefficient_individual_discretionary_tours_made_by_full_time_worker_maint,coefficient_individual_discretionary_tours_made_by_full_time_worker_business2,coefficient_individual_discretionary_tours_made_by_full_time_worker_eat_business util_individual_discretionary_tours_made_by_part_time_worker,@(df.pemploy==2)*df.num_discr_tours,coefficient_individual_discretionary_tours_made_by_part_time_worker_no_subtours,coefficient_individual_discretionary_tours_made_by_part_time_worker_eat,coefficient_individual_discretionary_tours_made_by_part_time_worker_business1,coefficient_individual_discretionary_tours_made_by_part_time_worker_maint,coefficient_individual_discretionary_tours_made_by_part_time_worker_business2,coefficient_individual_discretionary_tours_made_by_part_time_worker_eat_business util_individual_eating_out_tours_made_by_person,num_eatout_tours,coefficient_individual_eating_out_tours_made_by_person_no_subtours,coefficient_individual_eating_out_tours_made_by_person_eat,coefficient_individual_eating_out_tours_made_by_person_business1,coefficient_individual_eating_out_tours_made_by_person_maint,coefficient_individual_eating_out_tours_made_by_person_business2,coefficient_individual_eating_out_tours_made_by_person_eat_business diff --git a/activitysim/examples/prototype_mtc_extended/configs/annotate_non_mandatory_destination.csv b/activitysim/examples/prototype_mtc_extended/configs/annotate_non_mandatory_destination.csv new file mode 100644 index 0000000000..cdd627bb62 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/annotate_non_mandatory_destination.csv @@ -0,0 +1,3 @@ +Description,Target,Expression +overwrite non-mandatory tour destination for school escort tours,_school_escort_tour_destination,"reindex(school_escort_tours.destination, df.index)" +,destination,"np.where(_school_escort_tour_destination.isna(), df.destination, _school_escort_tour_destination)" \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc_extended/configs/annotate_non_mandatory_tour_frequency.csv b/activitysim/examples/prototype_mtc_extended/configs/annotate_non_mandatory_tour_frequency.csv new file mode 100644 index 0000000000..a4861c99da --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/annotate_non_mandatory_tour_frequency.csv @@ -0,0 +1,6 @@ +Description,Target,Expression +# re-calculating tour counts with school escorting tours included,, +,tour_type_num,"df.groupby(['person_id', 'tour_type']).cumcount() + 1" +,tour_type_count,"tour_type_num + df.groupby(['person_id', 'tour_type']).cumcount(ascending=False)" +,tour_num,"df.groupby('person_id').cumcount() + 1" +,tour_count,"tour_num + df.groupby('person_id').cumcount(ascending=False)" \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc_extended/configs/non_mandatory_tour_destination.yaml b/activitysim/examples/prototype_mtc_extended/configs/non_mandatory_tour_destination.yaml new file mode 100644 index 0000000000..48d8ca8d96 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/non_mandatory_tour_destination.yaml @@ -0,0 +1,57 @@ +SAMPLE_SPEC: non_mandatory_tour_destination_sample.csv +SPEC: non_mandatory_tour_destination.csv +COEFFICIENTS: non_mandatory_tour_destination_coefficients.csv + +SAMPLE_SIZE: 30 + +SIZE_TERM_SELECTOR: non_mandatory + +# we can't use use household income_segment as this will also be set for non-workers +CHOOSER_SEGMENT_COLUMN_NAME: tour_type + +# optional (comment out if not desired) +DEST_CHOICE_LOGSUM_COLUMN_NAME: destination_logsum + +# comment out DEST_CHOICE_LOGSUM_COLUMN_NAME if saved alt logsum table +DEST_CHOICE_SAMPLE_TABLE_NAME: tour_destination_sample + + +SEGMENTS: + - shopping + - othmaint + - othdiscr + - eatout + - social + - escort + +SIMULATE_CHOOSER_COLUMNS: + - tour_type + - home_zone_id + - person_id + +LOGSUM_SETTINGS: tour_mode_choice.yaml + +annotate_tours: + SPEC: annotate_non_mandatory_destination + DF: df + TABLES: + - tours + - school_escort_tours + +# model-specific logsum-related settings +CHOOSER_ORIG_COL_NAME: home_zone_id +ALT_DEST_COL_NAME: alt_dest +IN_PERIOD: + shopping: 14 + othmaint: 14 + othdiscr: 14 + eatout: 14 + social: 14 + escort: 14 +OUT_PERIOD: + shopping: 14 + othmaint: 14 + othdiscr: 14 + eatout: 14 + social: 14 + escort: 14 \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc_extended/configs/non_mandatory_tour_scheduling.yaml b/activitysim/examples/prototype_mtc_extended/configs/non_mandatory_tour_scheduling.yaml new file mode 100644 index 0000000000..488ba6b827 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/non_mandatory_tour_scheduling.yaml @@ -0,0 +1,22 @@ + +SPEC: tour_scheduling_nonmandatory.csv +COEFFICIENTS: tour_scheduling_nonmandatory_coefficients.csv + +LOGIT_TYPE: MNL + +preprocessor: + SPEC: non_mandatory_tour_scheduling_annotate_tours_preprocessor + DF: non_mandatory_tours + TABLES: + - land_use + - joint_tour_participants + - school_escort_tours + +SIMULATE_CHOOSER_COLUMNS: + - ptype + - num_children + - roundtrip_auto_time_to_work + - num_mand + - num_escort_tours + - num_non_escort_tours + - adult diff --git a/activitysim/examples/prototype_mtc_extended/configs/non_mandatory_tour_scheduling_annotate_tours_preprocessor.csv b/activitysim/examples/prototype_mtc_extended/configs/non_mandatory_tour_scheduling_annotate_tours_preprocessor.csv new file mode 100644 index 0000000000..c0281468fe --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/non_mandatory_tour_scheduling_annotate_tours_preprocessor.csv @@ -0,0 +1,11 @@ +Description,Target,Expression +destination in central business district,destination_in_cbd,"(reindex(land_use.area_type, non_mandatory_tours.destination) < setting('cbd_threshold')) * 1" +#,, +,num_person_joint_tours,"reindex_i(joint_tour_participants.groupby('person_id').size(), non_mandatory_tours.person_id)" +# included for school escorting model,, +flag to denote outbound school escort tours,is_outbound_school_escort_tour,"non_mandatory_tours.index.isin(school_escort_tours[school_escort_tours['school_escort_direction'] == 'outbound'].index)" +flag to denote inbound school escort tours,is_inbound_school_escort_tour,"non_mandatory_tours.index.isin(school_escort_tours[school_escort_tours['school_escort_direction'] == 'inbound'].index)" +school escort tour start time,school_escort_tour_start,"reindex(school_escort_tours.start, non_mandatory_tours.index)" +school escort tour next start time,school_escort_tour_next_start,"reindex(school_escort_tours.next_pure_escort_start, non_mandatory_tours.index)" +school escort tour end time,school_escort_tour_end,"reindex(school_escort_tours.end, non_mandatory_tours.index)" + diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting.yaml b/activitysim/examples/prototype_mtc_extended/configs/school_escorting.yaml new file mode 100644 index 0000000000..31527cb1df --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting.yaml @@ -0,0 +1,54 @@ +# The school escort model as written in this prototype is not +# compatible with sharrow, so "sharrow_skip" must be activated here. +# Currently the spec file has a few lines that evaluate differently in +# the sharrow implementation, resulting in failure that are flagged by +# the `test` mode. Once these are fixed (and string comparisons are +# minimized for performance) this `sharrow_skip` setting can be removed. +sharrow_skip: true + +OUTBOUND_SPEC: school_escorting_outbound.csv +OUTBOUND_COEFFICIENTS: school_escorting_coefficients_outbound.csv + +INBOUND_SPEC: school_escorting_inbound.csv +INBOUND_COEFFICIENTS: school_escorting_coefficients_inbound.csv + +OUTBOUND_COND_SPEC: school_escorting_outbound_cond.csv +OUTBOUND_COND_COEFFICIENTS: school_escorting_coefficients_outbound_cond.csv + +ALTS: school_escorting_alts.csv + +LOGIT_TYPE: MNL + +NUM_ESCORTEES: 3 +NUM_CHAPERONES: 2 + +preprocessor_outbound: + SPEC: school_escorting_preprocessor_outbound + DF: df + TABLES: + - persons + - tours + +preprocessor_inbound: + SPEC: school_escorting_preprocessor_inbound + DF: df + TABLES: + - persons + - tours + +preprocessor_outbound_cond: + SPEC: school_escorting_preprocessor_outbound + DF: df + TABLES: + - persons + - tours + +SIMULATE_CHOOSER_COLUMNS: + - home_zone_id + - income + - auto_ownership + - num_workers + +CONSTANTS: + max_bin_difference_between_departure_times: 1 + mins_per_time_bin: 60 diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_alts.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_alts.csv new file mode 100644 index 0000000000..eca661755a --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_alts.csv @@ -0,0 +1,158 @@ +Alt,bundle1,bundle2,bundle3,chauf1,chauf2,chauf3,nbund1,nbund2,nbundles,nrs1,npe1,nrs2,npe2,Description +1,0,0,0,0,0,0,0,0,0,0,0,0,0,no one is escorted +2,1,0,0,1,0,0,1,0,1,1,0,0,0,child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing +3,1,0,0,2,0,0,1,0,1,0,1,0,0,child 1 is escorted in bundle 1 by chauffeur 1 as pure escort +4,1,0,0,3,0,0,0,1,1,0,0,1,0,child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing +5,1,0,0,4,0,0,0,1,1,0,0,0,1,child 1 is escorted in bundle 1 by chauffeur 2 as pure escort +6,0,1,0,0,1,0,1,0,1,1,0,0,0,child 2 is escorted in bundle 1 by chauffeur 1 as ride sharing +7,0,1,0,0,2,0,1,0,1,0,1,0,0,child 2 is escorted in bundle 1 by chauffeur 1 as pure escort +8,0,1,0,0,3,0,0,1,1,0,0,1,0,child 2 is escorted in bundle 1 by chauffeur 2 as ride sharing +9,0,1,0,0,4,0,0,1,1,0,0,0,1,child 2 is escorted in bundle 1 by chauffeur 2 as pure escort +10,0,0,1,0,0,1,1,0,1,1,0,0,0,child 3 is escorted in bundle 1 by chauffeur 1 as ride sharing +11,0,0,1,0,0,2,1,0,1,0,1,0,0,child 3 is escorted in bundle 1 by chauffeur 1 as pure escort +12,0,0,1,0,0,3,0,1,1,0,0,1,0,child 3 is escorted in bundle 1 by chauffeur 2 as ride sharing +13,0,0,1,0,0,4,0,1,1,0,0,0,1,child 3 is escorted in bundle 1 by chauffeur 2 as pure escort +14,1,1,0,1,1,0,1,0,1,1,0,0,0,child 1 and 2 are escorted in bundle 1 by chauffeur 1 as ride sharing +15,1,1,0,2,2,0,1,0,1,0,1,0,0,child 1 and 2 are escorted in bundle 1 by chauffeur 1 as pure escort +16,1,1,0,3,3,0,0,1,1,0,0,1,0,child 1 and 2 are escorted in bundle 1 by chauffeur 2 as ride sharing +17,1,1,0,4,4,0,0,1,1,0,0,0,1,child 1 and 2 are escorted in bundle 1 by chauffeur 2 as pure escort +18,1,0,1,1,0,1,1,0,1,1,0,0,0,child 1 and 3 are escorted in bundle 1 by chauffeur 1 as ride sharing +19,1,0,1,2,0,2,1,0,1,0,1,0,0,child 1 and 3 are escorted in bundle 1 by chauffeur 1 as pure escort +20,1,0,1,3,0,3,0,1,1,0,0,1,0,child 1 and 3 are escorted in bundle 1 by chauffeur 2 as ride sharing +21,1,0,1,4,0,4,0,1,1,0,0,0,1,child 1 and 3 are escorted in bundle 1 by chauffeur 2 as pure escort +22,0,1,1,0,1,1,1,0,1,1,0,0,0,child 2 and 3 are escorted in bundle 1 by chauffeur 1 as ride sharing +23,0,1,1,0,2,2,1,0,1,0,1,0,0,child 2 and 3 are escorted in bundle 1 by chauffeur 1 as pure escort +24,0,1,1,0,3,3,0,1,1,0,0,1,0,child 2 and 3 are escorted in bundle 1 by chauffeur 2 as ride sharing +25,0,1,1,0,4,4,0,1,1,0,0,0,1,child 2 and 3 are escorted in bundle 1 by chauffeur 2 as pure escort +26,1,2,0,1,2,0,2,0,2,1,1,0,0,child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 1 as pure escort +27,1,2,0,1,3,0,1,1,2,1,0,1,0,child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing +28,1,2,0,1,4,0,1,1,2,1,0,0,1,child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 2 as pure escort +29,1,2,0,2,1,0,2,0,2,1,1,0,0,child 1 is escorted in bundle 1 by chauffeur 1 as pure escort and child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing +30,1,2,0,2,2,0,2,0,2,0,2,0,0,child 1 is escorted in bundle 1 by chauffeur 1 as pure escort and child 2 is escorted in bundle 2 by chauffeur 1 as pure escort +31,1,2,0,2,3,0,1,1,2,0,1,1,0,child 1 is escorted in bundle 1 by chauffeur 1 as pure escort and child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing +32,1,2,0,2,4,0,1,1,2,0,1,0,1,child 1 is escorted in bundle 1 by chauffeur 1 as pure escort and child 2 is escorted in bundle 2 by chauffeur 2 as pure escort +33,1,2,0,3,1,0,1,1,2,1,0,1,0,child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing +34,1,2,0,3,2,0,1,1,2,0,1,1,0,child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 1 as pure escort +35,1,2,0,3,4,0,0,2,2,0,0,1,1,child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 2 as pure escort +36,1,2,0,4,1,0,1,1,2,1,0,0,1,child 1 is escorted in bundle 1 by chauffeur 2 as pure escort and child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing +37,1,2,0,4,2,0,1,1,2,0,1,0,1,child 1 is escorted in bundle 1 by chauffeur 2 as pure escort and child 2 is escorted in bundle 2 by chauffeur 1 as pure escort +38,1,2,0,4,3,0,0,2,2,0,0,1,1,child 1 is escorted in bundle 1 by chauffeur 2 as pure escort and child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing +39,1,2,0,4,4,0,0,2,2,0,0,0,2,child 1 is escorted in bundle 1 by chauffeur 2 as pure escort and child 2 is escorted in bundle 2 by chauffeur 2 as pure escort +40,1,0,2,1,0,2,2,0,2,1,1,0,0,child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 1 as pure escorting +41,1,0,2,1,0,3,1,1,2,1,0,1,0,child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 2 as ride sharing +42,1,0,2,1,0,4,1,1,2,1,0,0,1,child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 2 as pure escorting +43,1,0,2,2,0,1,2,0,2,1,1,0,0,child 1 is escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as ride sharing +44,1,0,2,2,0,2,2,0,2,0,2,0,0,child 1 is escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as pure escorting +45,1,0,2,2,0,3,1,1,2,0,1,1,0,child 1 is escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as ride sharing +46,1,0,2,2,0,4,1,1,2,0,1,0,1,child 1 is escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as pure escorting +47,1,0,2,3,0,1,1,1,2,1,0,1,0,child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 1 as ride sharing +48,1,0,2,3,0,2,1,1,2,0,1,1,0,child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 1 as pure escorting +49,1,0,2,3,0,4,0,2,2,0,0,1,1,child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 2 as pure escorting +50,1,0,2,4,0,1,1,1,2,1,0,0,1,child 1 is escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as ride sharing +51,1,0,2,4,0,2,1,1,2,0,1,0,1,child 1 is escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as pure escorting +52,1,0,2,4,0,3,0,2,2,0,0,1,1,child 1 is escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as ride sharing +53,1,0,2,4,0,4,0,2,2,0,0,0,2,child 1 is escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as pure escorting +54,0,1,2,0,1,2,2,0,2,1,1,0,0,child 2 is escorted in bundle 1 by chauffeur 1 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 1 as pure escorting +55,0,1,2,0,1,3,1,1,2,1,0,1,0,child 2 is escorted in bundle 1 by chauffeur 1 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 2 as ride sharing +56,0,1,2,0,1,4,1,1,2,1,0,0,1,child 2 is escorted in bundle 1 by chauffeur 1 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 2 as pure escorting +57,0,1,2,0,2,1,2,0,2,1,1,0,0,child 2 is escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as ride sharing +58,0,1,2,0,2,2,2,0,2,0,2,0,0,child 2 is escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as pure escorting +59,0,1,2,0,2,3,1,1,2,0,1,1,0,child 2 is escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as ride sharing +60,0,1,2,0,2,4,1,1,2,0,1,0,1,child 2 is escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as pure escorting +61,0,1,2,0,3,1,1,1,2,1,0,1,0,child 2 is escorted in bundle 1 by chauffeur 2 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 1 as ride sharing +62,0,1,2,0,3,2,1,1,2,0,1,1,0,child 2 is escorted in bundle 1 by chauffeur 2 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 1 as pure escorting +63,0,1,2,0,3,4,0,2,2,0,0,1,1,child 2 is escorted in bundle 1 by chauffeur 2 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 2 as pure escorting +64,0,1,2,0,4,1,1,1,2,1,0,0,1,child 2 is escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as ride sharing +65,0,1,2,0,4,2,1,1,2,0,1,0,1,child 2 is escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as pure escorting +66,0,1,2,0,4,3,0,2,2,0,0,1,1,child 2 is escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as ride sharing +67,0,1,2,0,4,4,0,2,2,0,0,0,2,child 2 is escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as pure escorting +68,1,1,1,1,1,1,1,0,1,1,0,0,0,"child 1, 2 and 3 are escorted in bundle 1 by chauffeur 1 as ride sharing" +69,1,1,1,2,2,2,1,0,1,0,1,0,0,"child 1, 2 and 3 are escorted in bundle 1 by chauffeur 1 as pure escort" +70,1,1,1,3,3,3,0,1,1,0,0,1,0,"child 1, 2 and 3 are escorted in bundle 1 by chauffeur 2 as ride sharing" +71,1,1,1,4,4,4,0,1,1,0,0,0,1,"child 1, 2 and 3 are escorted in bundle 1 by chauffeur 2 as pure escort" +72,1,2,3,1,2,2,3,0,3,1,2,0,0,"child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +73,1,2,3,1,2,3,2,1,3,1,1,1,0,"child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as ride sharing" +74,1,2,3,1,2,4,2,1,3,1,1,0,1,"child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +75,1,2,3,1,3,2,2,1,3,1,1,1,0,"child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +76,1,2,3,1,3,4,1,2,3,1,0,1,1,"child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +77,1,2,3,1,4,2,2,1,3,1,1,0,1,"child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +78,1,2,3,1,4,3,1,2,3,1,0,1,1,"child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as ride sharing" +79,1,2,3,1,4,4,1,2,3,1,0,0,2,"child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +80,1,2,3,2,1,2,3,0,3,1,2,0,0,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +81,1,2,3,2,1,3,2,1,3,1,1,1,0,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 2 as ride sharing" +82,1,2,3,2,1,4,2,1,3,1,1,0,1,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +83,1,2,3,2,2,1,3,0,3,1,2,0,0,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as ride sharing" +84,1,2,3,2,2,2,3,0,3,0,3,0,0,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +85,1,2,3,2,2,3,2,1,3,0,2,1,0,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as ride sharing" +86,1,2,3,2,2,4,2,1,3,0,2,0,1,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +87,1,2,3,2,3,1,2,1,3,1,1,1,0,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 1 as ride sharing" +88,1,2,3,2,3,2,2,1,3,0,2,1,0,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +89,1,2,3,2,3,4,1,2,3,0,1,1,1,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +90,1,2,3,2,4,1,2,1,3,1,1,0,1,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as ride sharing" +91,1,2,3,2,4,2,2,1,3,0,2,0,1,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +92,1,2,3,2,4,3,1,2,3,0,1,1,1,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as ride sharing" +93,1,2,3,2,4,4,1,2,3,0,1,0,2,"child 1 is escorted in bundle 1 by chauffeur 1 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +94,1,2,3,3,1,2,2,1,3,1,1,1,0,"child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +95,1,2,3,3,1,4,1,2,3,1,0,1,1,"child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +96,1,2,3,3,2,1,2,1,3,1,1,1,0,"child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as ride sharing" +97,1,2,3,3,2,2,2,1,3,0,2,1,0,"child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +98,1,2,3,3,2,4,1,2,3,0,1,1,1,"child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +99,1,2,3,3,4,1,1,2,3,1,0,1,1,"child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as ride sharing" +100,1,2,3,3,4,2,1,2,3,0,1,1,1,"child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +101,1,2,3,3,4,4,0,3,3,0,0,1,2,"child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +102,1,2,3,4,1,2,2,1,3,1,1,0,1,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +103,1,2,3,4,1,3,1,2,3,1,0,1,1,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 2 as ride sharing" +104,1,2,3,4,1,4,1,2,3,1,0,0,2,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +105,1,2,3,4,2,1,2,1,3,1,1,0,1,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as ride sharing" +106,1,2,3,4,2,2,2,1,3,0,2,0,1,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +107,1,2,3,4,2,3,1,2,3,0,1,1,1,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as ride sharing" +108,1,2,3,4,2,4,1,2,3,0,1,0,2,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 1 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +109,1,2,3,4,3,1,1,2,3,1,0,1,1,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 1 as ride sharing" +110,1,2,3,4,3,2,1,2,3,0,1,1,1,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +111,1,2,3,4,3,4,0,3,3,0,0,1,2,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing, and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +112,1,2,3,4,4,1,1,2,3,1,0,0,2,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as ride sharing" +113,1,2,3,4,4,2,1,2,3,0,1,0,2,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 1 as pure escort" +114,1,2,3,4,4,3,0,3,3,0,0,1,2,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as ride sharing" +115,1,2,3,4,4,4,0,3,3,0,0,0,3,"child 1 is escorted in bundle 1 by chauffeur 2 as pure escort, child 2 is escorted in bundle 2 by chauffeur 2 as pure escort and child 3 is escorted in bundle 3 by chauffeur 2 as pure escort" +116,1,1,2,1,1,2,2,0,2,1,1,0,0,child 1 and 2 are escorted in bundle 1 by chauffeur 1 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 1 as pure escort +117,1,1,2,1,1,3,1,1,2,1,0,1,0,child 1 and 2 are escorted in bundle 1 by chauffeur 1 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 2 as ride sharing +118,1,1,2,1,1,4,1,1,2,1,0,0,1,child 1 and 2 are escorted in bundle 1 by chauffeur 1 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 2 as pure escort +119,1,1,2,2,2,1,2,0,2,1,1,0,0,child 1 and 2 are escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as ride sharing +120,1,1,2,2,2,2,2,0,2,0,2,0,0,child 1 and 2 are escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as pure escort +121,1,1,2,2,2,3,1,1,2,0,1,1,0,child 1 and 2 are escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as ride sharing +122,1,1,2,2,2,4,1,1,2,0,1,0,1,child 1 and 2 are escorted in bundle 1 by chauffeur 1 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as pure escort +123,1,1,2,3,3,1,1,1,2,1,0,1,0,child 1 and 2 are escorted in bundle 1 by chauffeur 2 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 1 as ride sharing +124,1,1,2,3,3,2,1,1,2,0,1,1,0,child 1 and 2 are escorted in bundle 1 by chauffeur 2 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 1 as pure escort +125,1,1,2,3,3,4,0,2,2,0,0,1,1,child 1 and 2 are escorted in bundle 1 by chauffeur 2 as ride sharing and child 3 is escorted in bundle 2 by chauffeur 2 as pure escort +126,1,1,2,4,4,1,1,1,2,1,0,0,1,child 1 and 2 are escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as ride sharing +127,1,1,2,4,4,2,1,1,2,0,1,0,1,child 1 and 2 are escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 1 as pure escort +128,1,1,2,4,4,3,0,2,2,0,0,1,1,child 1 and 2 are escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as ride sharing +129,1,1,2,4,4,4,0,2,2,0,0,0,2,child 1 and 2 are escorted in bundle 1 by chauffeur 2 as pure escort and child 3 is escorted in bundle 2 by chauffeur 2 as pure escort +130,1,2,1,1,2,1,2,0,2,1,1,0,0,child 1 and 3 are escorted in bundle 1 by chauffeur 1 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 1 as pure escort +131,1,2,1,1,3,1,1,1,2,1,0,1,0,child 1 and 3 are escorted in bundle 1 by chauffeur 1 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing +132,1,2,1,1,4,1,1,1,2,1,0,0,1,child 1 and 3 are escorted in bundle 1 by chauffeur 1 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 2 as pure escort +133,1,2,1,2,1,2,2,0,2,1,1,0,0,child 1 and 3 are escorted in bundle 1 by chauffeur 1 as pure escort and child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing +134,1,2,1,2,2,2,2,0,2,0,2,0,0,child 1 and 3 are escorted in bundle 1 by chauffeur 1 as pure escort and child 2 is escorted in bundle 2 by chauffeur 1 as pure escort +135,1,2,1,2,3,2,1,1,2,0,1,1,0,child 1 and 3 are escorted in bundle 1 by chauffeur 1 as pure escort and child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing +136,1,2,1,2,4,2,1,1,2,0,1,0,1,child 1 and 3 are escorted in bundle 1 by chauffeur 1 as pure escort and child 2 is escorted in bundle 2 by chauffeur 2 as pure escort +137,1,2,1,3,1,3,1,1,2,1,0,1,0,child 1 and 3 are escorted in bundle 1 by chauffeur 2 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing +138,1,2,1,3,2,3,1,1,2,0,1,1,0,child 1 and 3 are escorted in bundle 1 by chauffeur 2 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 1 as pure escort +139,1,2,1,3,4,3,0,2,2,0,0,1,1,child 1 and 3 are escorted in bundle 1 by chauffeur 2 as ride sharing and child 2 is escorted in bundle 2 by chauffeur 2 as pure escort +140,1,2,1,4,1,4,1,1,2,1,0,0,1,child 1 and 3 are escorted in bundle 1 by chauffeur 2 as pure escort and child 2 is escorted in bundle 2 by chauffeur 1 as ride sharing +141,1,2,1,4,2,4,1,1,2,0,1,0,1,child 1 and 3 are escorted in bundle 1 by chauffeur 2 as pure escort and child 2 is escorted in bundle 2 by chauffeur 1 as pure escort +142,1,2,1,4,3,4,0,2,2,0,0,1,1,child 1 and 3 are escorted in bundle 1 by chauffeur 2 as pure escort and child 2 is escorted in bundle 2 by chauffeur 2 as ride sharing +143,1,2,1,4,4,4,0,2,2,0,0,0,2,child 1 and 3 are escorted in bundle 1 by chauffeur 2 as pure escort and child 2 is escorted in bundle 2 by chauffeur 2 as pure escort +144,1,2,2,1,2,2,2,0,2,1,1,0,0,child 2 and 3 are escorted in bundle 2 by chauffeur 1 as ride sharing and child 1 is escorted in bundle 1 by chauffeur 1 as pure escort +145,1,2,2,1,3,3,1,1,2,1,0,1,0,child 2 and 3 are escorted in bundle 2 by chauffeur 1 as ride sharing and child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing +146,1,2,2,1,4,4,1,1,2,1,0,0,1,child 2 and 3 are escorted in bundle 2 by chauffeur 1 as ride sharing and child 1 is escorted in bundle 1 by chauffeur 2 as pure escort +147,1,2,2,2,1,1,2,0,2,1,1,0,0,child 2 and 3 are escorted in bundle 2 by chauffeur 1 as pure escort and child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing +148,1,2,2,2,2,2,2,0,2,0,2,0,0,child 2 and 3 are escorted in bundle 2 by chauffeur 1 as pure escort and child 1 is escorted in bundle 1 by chauffeur 1 as pure escort +149,1,2,2,2,3,3,1,1,2,0,1,1,0,child 2 and 3 are escorted in bundle 2 by chauffeur 1 as pure escort and child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing +150,1,2,2,2,4,4,1,1,2,0,1,0,1,child 2 and 3 are escorted in bundle 2 by chauffeur 1 as pure escort and child 1 is escorted in bundle 1 by chauffeur 2 as pure escort +151,1,2,2,3,1,1,1,1,2,1,0,1,0,child 2 and 3 are escorted in bundle 2 by chauffeur 2 as ride sharing and child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing +152,1,2,2,3,2,2,1,1,2,0,1,1,0,child 2 and 3 are escorted in bundle 2 by chauffeur 2 as ride sharing and child 1 is escorted in bundle 1 by chauffeur 1 as pure escort +153,1,2,2,3,4,4,0,2,2,0,0,1,1,child 2 and 3 are escorted in bundle 2 by chauffeur 2 as ride sharing and child 1 is escorted in bundle 1 by chauffeur 2 as pure escort +154,1,2,2,4,1,1,1,1,2,1,0,0,1,child 2 and 3 are escorted in bundle 2 by chauffeur 2 as pure escort and child 1 is escorted in bundle 1 by chauffeur 1 as ride sharing +155,1,2,2,4,2,2,1,1,2,0,1,0,1,child 2 and 3 are escorted in bundle 2 by chauffeur 2 as pure escort and child 1 is escorted in bundle 1 by chauffeur 1 as pure escort +156,1,2,2,4,3,3,0,2,2,0,0,1,1,child 2 and 3 are escorted in bundle 2 by chauffeur 2 as pure escort and child 1 is escorted in bundle 1 by chauffeur 2 as ride sharing +157,1,2,2,4,4,4,0,2,2,0,0,0,2,child 2 and 3 are escorted in bundle 2 by chauffeur 2 as pure escort and child 1 is escorted in bundle 1 by chauffeur 2 as pure escort diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_coefficients_inbound.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_coefficients_inbound.csv new file mode 100644 index 0000000000..d6bc1947ff --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_coefficients_inbound.csv @@ -0,0 +1,41 @@ +coefficient_name,value,constrain +coef_unavail,-999,T +coef_child_age_16p_noes,0.17488,F +coef_child_age_6_to_15_noes,-0.41751,F +coef_child_age_u5_noes,-1.36718,F +coef_ln_dist_from_school_noes,-0.01787,F +coef_ln_dist_from_school_u6_noes,-0.23304,F +coef_ln_dist_from_school_6to9_noes,-0.07286,F +coef_child_age_16p_rs,1.97184 +coef_child_age_10to15_rs,1.73544 +coef_child_age_6to9_rs,1.73544 +coef_child_age_u6_rs,1.34996 +coef_hh_inc_u25k_noes,0.0,F +coef_hh_inc_25to50k_noes,0.0,F +coef_zero_auto_hh_noes,0.13165,F +coef_cars_lt_workers_rs,-3.35586,F +coef_cars_lt_workers_pe,-1.59062,F +coef_chauf_female_rs,-0.44827,F +coef_chauf_male_rs,-0.90832,F +coef_chauf_female_pe,-0.68399,F +coef_chauf_male_pe,-1.01783,F +coef_chauf_pt_worker_rs,0.51244,F +coef_chauf_pt_worker_pe,0.23496,F +coef_chauf_non_worker_pe,0.69245,F +coef_chauf_univ_stud_re,0.47395,F +coef_chauf_age_u35_pe,0.00000,F +coef_chauf_time_to_work_or_univ_rs,-0.01974,F +coef_chauf_walk_dist_to_work_or_univ_rs,-0.73155,F +coef_chauf_walk_dist_to_work_or_univ_pe,0.00000,F +coef_abs_dev_distance,-0.08011,F +coef_rel_dev_distance,0.0,F +coef_same_taz_escort,1.44053,F +coef_same_taz_no_escort,1.96760,F +coef_no_escort_outbound,2.04553,F +coef_outbound_rs,0.0,F +coef_same_chauf,1.14533,F +coef_calib_child_age_u6_rs,8.75011,F +coef_calib_child_age_16p_rs,-0.20,F +coef_calib_child_age_6to15_noes,-3.46362,F +coef_calib_child_age_u6_noes,-0.36565,F +coef_calib_child_age_6to15_rs,-1.45344,F diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_coefficients_outbound.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_coefficients_outbound.csv new file mode 100644 index 0000000000..14f1e7d5f7 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_coefficients_outbound.csv @@ -0,0 +1,40 @@ +coefficient_name,value,constrain +coef_unavail,-999,T +coef_child_age_16p_noes,1.07391,F +coef_child_age_10_to_15_noes,0.46127,F +coef_child_age_u9_noes,0.13590,F +coef_ln_dist_to_school_noes,-0.33583,F +coef_ln_dist_to_school_u6_noes,-1.00920,F +coef_ln_dist_to_school_6to9_noes,-0.11156,F +coef_child_age_16p_rs,0.34244,F +coef_child_age_10to15_rs,.27494,F +coef_child_age_6to9_rs,0.20757,F +coef_child_age_u6_rs,0.33051,F +coef_child_dist_pe,-0.04593,F +coef_hh_inc_u25k_noes,0.18901,F +coef_hh_inc_25to50k_noes,0.12172,F +coef_zero_auto_hh_noes,9.0,F +coef_cars_lt_workers_rs,-0.88274,F +coef_cars_lt_workers_pe,-0.55291,F +coef_chauf_female_rs,-0.27828,F +coef_chauf_male_rs,-0.67320,F +coef_chauf_female_pe,-0.84859,F +coef_chauf_male_pe,-0.80965,F +coef_chauf_pt_worker_rs,-0.11422,F +coef_chauf_pt_worker_pe,0.51792,F +coef_chauf_non_worker_pe,0.51577,F +coef_chauf_univ_stud_re,0.0,F +coef_chauf_age_u35_pe,-0.33715,F +coef_chauf_time_to_work_or_univ_rs,0.0,F +coef_chauf_walk_dist_to_work_or_univ_rs,0.77326,F +coef_chauf_walk_dist_to_work_or_univ_pe,0.0,F +coef_abs_dev_distance,-0.07136,F +coef_rel_dev_distance,-0.09951,F +coef_same_taz_escort,2.77591,F +coef_same_taz_no_escort,2.62969,F +coef_same_taz_no_escort_23,2.21201,F +coef_calib_child_age_u6_rs,8.55400,F +coef_calib_child_age_16p_rs,-0.2000,F +coef_calib_child_age_6to15_noes,-4.53067,F +coef_calib_child_age_6to15_rs,-2.41923,F +coef_calib_child_age_u6_noes,-0.67902,F diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_coefficients_outbound_cond.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_coefficients_outbound_cond.csv new file mode 100644 index 0000000000..079d1e8450 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_coefficients_outbound_cond.csv @@ -0,0 +1,41 @@ +coefficient_name,value,constrain +coef_unavail,-999,T +coef_child_age_16p_noes,-0.33924,F +coef_child_age_10_to_15_noes,-0.78691,F +coef_child_age_u9_noes,-0.97142,F +coef_ln_dist_to_school_noes,-0.02112,F +coef_ln_dist_to_school_u6_noes,-0.81356,F +coef_ln_dist_to_school_6to9_noes,-0.12910,F +coef_child_age_16p_rs,0.93518,F +coef_child_age_10to15_rs,0.58009,F +coef_child_age_6to9_rs,0.36698,F +coef_child_age_u6_rs,0.29043,F +coef_child_dist_pe,-0.03624,F +coef_hh_inc_u25k_noes,0.33839,F +coef_hh_inc_25to50k_noes,0.05888,F +coef_zero_auto_hh_noes,9.00000,F +coef_cars_lt_workers_rs,-0.38588,F +coef_cars_lt_workers_pe,-0.01213,F +coef_chauf_female_rs,-0.49717,F +coef_chauf_male_rs,-0.94654,F +coef_chauf_female_pe,-0.98546,F +coef_chauf_male_pe,-1.05266,F +coef_chauf_pt_worker_rs,-0.74807,F +coef_chauf_pt_worker_pe,0.31729,F +coef_chauf_non_worker_pe,0.19211,F +coef_chauf_univ_stud_re,0.0,F +coef_chauf_age_u35_pe,-0.41194,F +coef_chauf_time_to_work_or_univ_rs,0.0,F +coef_chauf_walk_dist_to_work_or_univ_rs,0.38819,F +coef_chauf_walk_dist_to_work_or_univ_pe,0.0,F +coef_abs_dev_distance,-0.04497,F +coef_rel_dev_distance,-0.09067,F +coef_same_taz_escort,2.56855,F +coef_same_taz_no_escort,2.21201,F +coef_no_escort_inbound,1.72902,F +coef_same_chauf,0.99276,F +coef_calib_child_age_u6_rs,8.55400,F +coef_calib_child_age_16p_rs,-0.2000,F +coef_calib_child_age_6to15_noes,-4.53067,F +coef_calib_child_age_6to15_rs,-2.41923,F +coef_calib_child_age_u6_noes,-0.67902,F diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_inbound.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_inbound.csv new file mode 100644 index 0000000000..5dcc1ec377 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_inbound.csv @@ -0,0 +1,175 @@ +Label,Description,Expression,Coefficient +# ,Availability Conditions,, +util_one_child_to_school,Availability based on number of eligible children,((bundle2 + bundle3) > 0) & (num_children_going_to_school==1),coef_unavail +util_two_children_to_school,Availability based on number of eligible children,(bundle3 > 0) & (num_children_going_to_school == 2),coef_unavail +util_one_potential_chauffeur,Availability based on number of eligible chauffeurs,((bundle1 + bundle2 + bundle3) > 0) & (num_potential_chauffeurs == 0),coef_unavail +util_two_potential_chauffeurs,Availability based on number of eligible chauffeurs,((chauf1 > 2) | (chauf2 > 2) | (chauf3 > 2)) & (num_potential_chauffeurs == 1),coef_unavail +util_avail_rs_cdap_child1_chauf1,Availability for RideSharing by daily pattern - Child 1 and Chauffeur 1,(bundle1 > 0) & (chauf1 == 1) & (cdap_chauf1 != 'M'),coef_unavail +util_avail_rs_cdap_child1_chauf2,Availability for RideSharing by daily pattern - Child 1 and Chauffeur 2,(bundle1 > 0) & (chauf1 == 3) & (cdap_chauf2 != 'M'),coef_unavail +util_avail_rs_cdap_child2_chauf1,Availability for RideSharing by daily pattern - Child 2 and Chauffeur 1,(bundle2 > 0) & (chauf2 == 1) & (cdap_chauf1 != 'M'),coef_unavail +util_avail_rs_cdap_child2_chauf2,Availability for RideSharing by daily pattern - Child 2 and Chauffeur 2,(bundle2 > 0) & (chauf2 == 3) & (cdap_chauf2 != 'M'),coef_unavail +util_avail_rs_cdap_child3_chauf1,Availability for RideSharing by daily pattern - Child 3 and Chauffeur 1,(bundle3 > 0) & (chauf3 == 1) & (cdap_chauf1 != 'M'),coef_unavail +util_avail_rs_cdap_child3_chauf2,Availability for RideSharing by daily pattern - Child 3 and Chauffeur 2,(bundle3 > 0) & (chauf3 == 3) & (cdap_chauf2 != 'M'),coef_unavail +util_avail_rs_sync_child1_chauf1,Availability for RideSharing by synchronization - Child 1 and Chauffeur 1,@(df.bundle1 > 0) & (df.chauf1 == 1) & (np.abs(df.pref_depart_time_chauf1 + (df.time_mand1_to_school1 / mins_per_time_bin) - df.pref_depart_time_school1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child1_chauf2,Availability for RideSharing by synchronization - Child 1 and Chauffeur 2,@(df.bundle1 > 0) & (df.chauf1 == 3) & (np.abs(df.pref_depart_time_chauf2 + (df.time_mand2_to_school1 / mins_per_time_bin) - df.pref_depart_time_school1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child2_chauf1,Availability for RideSharing by synchronization - Child 2 and Chauffeur 1,@(df.bundle2 > 0) & (df.chauf2 == 1) & (np.abs(df.pref_depart_time_chauf1 + (df.time_mand1_to_school2 / mins_per_time_bin) - df.pref_depart_time_school2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child2_chauf2,Availability for RideSharing by synchronization - Child 2 and Chauffeur 2,@(df.bundle2 > 0) & (df.chauf2 == 3) & (np.abs(df.pref_depart_time_chauf2 + (df.time_mand2_to_school2 / mins_per_time_bin) - df.pref_depart_time_school2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child3_chauf1,Availability for RideSharing by synchronization - Child 3 and Chauffeur 1,@(df.bundle3 > 0) & (df.chauf3 == 1) & (np.abs(df.pref_depart_time_chauf1 + (df.time_mand1_to_school3 / mins_per_time_bin) - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child3_chauf2,Availability for RideSharing by synchronization - Child 3 and Chauffeur 2,@(df.bundle3 > 0) & (df.chauf3 == 3) & (np.abs(df.pref_depart_time_chauf2 + (df.time_mand2_to_school3 / mins_per_time_bin) - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_cdap_child1_chauf1,Availability for Pure-Escorting by daily pattern - Child 1 and Chauffeur 1,(bundle1 > 0) & (chauf1 == 2) & (ptype_chauf1 < 6) & (cdap_chauf1 == 'H'),coef_unavail +util_avail_pe_cdap_child1_chauf2,Availability for Pure-Escorting by daily pattern - Child 1 and Chauffeur 2,(bundle1 > 0) & (chauf1 == 4) & (ptype_chauf2 < 6) & (cdap_chauf2 == 'H'),coef_unavail +util_avail_pe_cdap_child2_chauf1,Availability for Pure-Escorting by daily pattern - Child 2 and Chauffeur 1,(bundle2 > 0) & (chauf2 == 2) & (ptype_chauf1 < 6) & (cdap_chauf1 == 'H'),coef_unavail +util_avail_pe_cdap_child2_chauf2,Availability for Pure-Escorting by daily pattern - Child 2 and Chauffeur 2,(bundle2 > 0) & (chauf2 == 4) & (ptype_chauf2 < 6) & (cdap_chauf2 == 'H'),coef_unavail +util_avail_pe_cdap_child3_chauf1,Availability for Pure-Escorting by daily pattern - Child 3 and Chauffeur 1,(bundle3 > 0) & (chauf3 == 2) & (ptype_chauf1 < 6) & (cdap_chauf1 == 'H'),coef_unavail +util_avail_pe_cdap_child3_chauf2,Availability for Pure-Escorting by daily pattern - Child 3 and Chauffeur 2,(bundle3 > 0) & (chauf3 == 4) & (ptype_chauf2 < 6) & (cdap_chauf2 == 'H'),coef_unavail +util_avail_pe_sync_child1_chauf1,Availability for Pure-Escorting by synchronization - Child 1 and Chauffeur 1,@(df.bundle1 > 0) & (df.chauf1 == 2) & (df.cdap_chauf1 == 'H') & (((df.pref_depart_time_chauf1 + (df.time_mand_to_home1 / mins_per_time_bin)) - (df.pref_depart_time_school1 - (df.time_home_to_school1 / mins_per_time_bin))) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child1_chauf2,Availability for Pure-Escorting by synchronization - Child 1 and Chauffeur 2,@(df.bundle1 > 0) & (df.chauf1 == 4) & (df.cdap_chauf2 == 'H') & (((df.pref_depart_time_chauf2 + (df.time_mand_to_home2 / mins_per_time_bin)) - (df.pref_depart_time_school1 - (df.time_home_to_school1 / mins_per_time_bin))) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child2_chauf1,Availability for Pure-Escorting by synchronization - Child 2 and Chauffeur 1,@(df.bundle2 > 0) & (df.chauf2 == 2) & (df.cdap_chauf1 == 'H') & (((df.pref_depart_time_chauf1 + (df.time_mand_to_home1 / mins_per_time_bin)) - (df.pref_depart_time_school2 - (df.time_home_to_school2 / mins_per_time_bin))) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child2_chauf2,Availability for Pure-Escorting by synchronization - Child 2 and Chauffeur 2,@(df.bundle2 > 0) & (df.chauf2 == 4) & (df.cdap_chauf2 == 'H') & (((df.pref_depart_time_chauf2 + (df.time_mand_to_home2 / mins_per_time_bin)) - (df.pref_depart_time_school2 - (df.time_home_to_school2 / mins_per_time_bin))) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child3_chauf1,Availability for Pure-Escorting by synchronization - Child 3 and Chauffeur 1,@(df.bundle3 > 0) & (df.chauf3 == 2) & (df.cdap_chauf1 == 'H') & (((df.pref_depart_time_chauf1 + (df.time_mand_to_home1 / mins_per_time_bin)) - (df.pref_depart_time_school3 - (df.time_home_to_school3 / mins_per_time_bin))) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child3_chauf2,Availability for Pure-Escorting by synchronization - Child 3 and Chauffeur 2,@(df.bundle3 > 0) & (df.chauf3 == 4) & (df.cdap_chauf2 == 'H') & (((df.pref_depart_time_chauf2 + (df.time_mand_to_home2 / mins_per_time_bin)) - (df.pref_depart_time_school3 - (df.time_home_to_school3 / mins_per_time_bin))) > max_bin_difference_between_departure_times),coef_unavail +util_avail_bundle_child_1and2,Availability for bundling child 1 and child 2,@(df.bundle1 == df.bundle2) & (df.bundle1 > 0) & (np.abs(df.pref_depart_time_school1 - df.pref_depart_time_school2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_bundle_child_1and3,Availability for bundling child 1 and child 3,@(df.bundle1 == df.bundle3) & (df.bundle1 > 0) & (np.abs(df.pref_depart_time_school1 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_bundle_child_2and3,Availability for bundling child 2 and child 3,@(df.bundle2 == df.bundle3) & (df.bundle2 > 0) & (np.abs(df.pref_depart_time_school2 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_mult_bundles_outbound1,Availability Chauffeur 1 - Expected arrival from previous pure escort must be before departure for subsequent escort,((nrs1 + npe1) > 1) & ~avail_multiple_bundles,coef_unavail +util_avail_mult_bundles_outbound2,Availability Chauffeur 2 - Expected arrival from previous pure escort must be before departure for subsequent escort,((nrs2 + npe2) > 1) & ~avail_multiple_bundles,coef_unavail +util_time_span11,Chauffeur 1 and Child 1 - time span for this alternative must not overlap time span reserved from outbound conditional,(bundle1 > 0) & ((chauf1 == 1) | (chauf1 == 2)) & (return_bin_outbound_school_escorting1 > pref_depart_time_school1),coef_unavail +util_time_span12,Chauffeur 1 and Child 2 - time span for this alternative must not overlap time span reserved from outbound conditional,(bundle1 > 0) & ((chauf2 == 1) | (chauf2 == 2)) & (return_bin_outbound_school_escorting1 > pref_depart_time_school2),coef_unavail +util_time_span13,Chauffeur 1 and Child 3 - time span for this alternative must not overlap time span reserved from outbound conditional,(bundle1 > 0) & ((chauf3 == 1) | (chauf3 == 2)) & (return_bin_outbound_school_escorting1 > pref_depart_time_school3),coef_unavail +util_time_span21,Chauffeur 2 and Child 1 - time span for this alternative must not overlap time span reserved from outbound conditional,(bundle1 > 0) & ((chauf1 == 3) | (chauf1 == 4)) & (return_bin_outbound_school_escorting2 > pref_depart_time_school1),coef_unavail +util_time_span22,Chauffeur 2 and Child 2 - time span for this alternative must not overlap time span reserved from outbound conditional,(bundle1 > 0) & ((chauf2 == 3) | (chauf2 == 4)) & (return_bin_outbound_school_escorting2 > pref_depart_time_school2),coef_unavail +util_time_span23,Chauffeur 2 and Child 3 - time span for this alternative must not overlap time span reserved from outbound conditional,(bundle1 > 0) & ((chauf3 == 3) | (chauf3 == 4)) & (return_bin_outbound_school_escorting2 > pref_depart_time_school3),coef_unavail +util_avail_pe_during_mand_child1_chauf1,Availability pure escort tour must take place before mandatory tour - Child 1 and Chauffeur 1,@(df.bundle1 > 0) & (df.chauf1 == 2) & (df.cdap_chauf1 == 'M') & ((df.pref_depart_time_chauf1 + max_bin_difference_between_departure_times) >= df.pref_depart_time_school1),coef_unavail +util_avail_pe_during_mand_child1_chauf2,Availability pure escort tour must take place before mandatory tour - Child 1 and Chauffeur 2,@(df.bundle1 > 0) & (df.chauf1 == 4) & (df.cdap_chauf2 == 'M') & ((df.pref_depart_time_chauf2 + max_bin_difference_between_departure_times) >= df.pref_depart_time_school1),coef_unavail +util_avail_pe_during_mand_child2_chauf1,Availability pure escort tour must take place before mandatory tour - Child 2 and Chauffeur 1,@(df.bundle2 > 0) & (df.chauf2 == 2) & (df.cdap_chauf1 == 'M') & ((df.pref_depart_time_chauf1 + max_bin_difference_between_departure_times) >= df.pref_depart_time_school2),coef_unavail +util_avail_pe_during_mand_child2_chauf2,Availability pure escort tour must take place before mandatory tour - Child 2 and Chauffeur 2,@(df.bundle2 > 0) & (df.chauf2 == 4) & (df.cdap_chauf2 == 'M') & ((df.pref_depart_time_chauf2 + max_bin_difference_between_departure_times) >= df.pref_depart_time_school2),coef_unavail +util_avail_pe_during_mand_child3_chauf1,Availability pure escort tour must take place before mandatory tour - Child 3 and Chauffeur 1,@(df.bundle3 > 0) & (df.chauf3 == 2) & (df.cdap_chauf1 == 'M') & ((df.pref_depart_time_chauf1 + max_bin_difference_between_departure_times) >= df.pref_depart_time_school3),coef_unavail +util_avail_pe_during_mand_child3_chauf2,Availability pure escort tour must take place before mandatory tour - Child 3 and Chauffeur 2,@(df.bundle3 > 0) & (df.chauf3 == 4) & (df.cdap_chauf2 == 'M') & ((df.pref_depart_time_chauf2 + max_bin_difference_between_departure_times) >= df.pref_depart_time_school3),coef_unavail +# ,No escorting,, +util_child1_age_16p_noes,Child 1 age 16 years or older - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 > 15),coef_child_age_16p_noes +util_child2_age_16p_noes,Child 2 age 16 years or older - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 > 15),coef_child_age_16p_noes +util_child3_age_16p_noes,Child 3 age 16 years or older - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 > 15),coef_child_age_16p_noes +util_child1_age_6_to_15_noes,Child 1 age 6 to 15 years - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 > 5) & (age_child1 < 16),coef_child_age_6_to_15_noes +util_child2_age_6_to_15_noes,Child 2 age 6 to 15 years - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 > 5) & (age_child2 < 16),coef_child_age_6_to_15_noes +util_child3_age_6_to_15_noes,Child 3 age 6 to 15 years - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 > 5) & (age_child3 < 16),coef_child_age_6_to_15_noes +util_child1_age_u5_noes,Child 1 age 5 years or younger - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 < 6),coef_child_age_u5_noes +util_child2_age_u5_noes,Child 2 age 5 years or younger - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 < 6),coef_child_age_u5_noes +util_child3_age_u5_noes,Child 3 age 5 years or younger - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 < 6),coef_child_age_u5_noes +util_ln_dist_from_school_child1_noes,Logged distance to school for Child 1 - No escort,@(df.bundle1 == 0) * (df.child_id1 > 0) * np.log(1 + df.dist_school_to_home1),coef_ln_dist_from_school_noes +util_ln_dist_from_school_child2_noes,Logged distance to school for Child 2 - No escort,@(df.bundle2 == 0) * (df.child_id2 > 0) * np.log(1 + df.dist_school_to_home2),coef_ln_dist_from_school_noes +util_ln_dist_from_school_child3_noes,Logged distance to school for Child 3 - No escort,@(df.bundle3 == 0) * (df.child_id3 > 0) * np.log(1 + df.dist_school_to_home3),coef_ln_dist_from_school_noes +util_ln_dist_from_school_child1_u6_noes,Logged distance to school for Child 1 under 6 years old - No escort,@(df.bundle1 == 0) * (df.child_id1 > 0) * (df.age_child1 < 6) * np.log(1 + df.dist_school_to_home1),coef_ln_dist_from_school_u6_noes +util_ln_dist_from_school_child2_u6_noes,Logged distance to school for Child 2 under 6 years old - No escort,@(df.bundle2 == 0) * (df.child_id2 > 0) * (df.age_child2 < 6) * np.log(1 + df.dist_school_to_home2),coef_ln_dist_from_school_u6_noes +util_ln_dist_from_school_child3_u6_noes,Logged distance to school for Child 3 under 6 years old - No escort,@(df.bundle3 == 0) * (df.child_id3 > 0) * (df.age_child3 < 6) * np.log(1 + df.dist_school_to_home3),coef_ln_dist_from_school_u6_noes +util_ln_dist_from_school_child1_6to9_noes,Logged distance to school for Child 1 6 to 9 years old - No escort,@(df.bundle1 == 0) * (df.child_id1 > 0) * (df.age_child1 > 5) * (df.age_child1 < 10) * np.log(1 + df.dist_school_to_home1),coef_ln_dist_from_school_6to9_noes +util_ln_dist_from_school_child2_6to9_noes,Logged distance to school for Child 2 6 to 9 years old - No escort,@(df.bundle2 == 0) * (df.child_id2 > 0) * (df.age_child2 > 5) * (df.age_child2 < 10) * np.log(1 + df.dist_school_to_home2),coef_ln_dist_from_school_6to9_noes +util_ln_dist_from_school_child3_6to9_noes,Logged distance to school for Child 3 6 to 9 years old - No escort,@(df.bundle3 == 0) * (df.child_id3 > 0) * (df.age_child3 > 5) * (df.age_child3 < 10) * np.log(1 + df.dist_school_to_home3),coef_ln_dist_from_school_6to9_noes +# ,Ride Sharing,, +util_child1_age_16p_rs,Child 1 age 16 years or older - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 15),coef_child_age_16p_rs +util_child2_age_16p_rs,Child 2 age 16 years or older - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 15),coef_child_age_16p_rs +util_child3_age_16p_rs,Child 3 age 16 years or older - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 15),coef_child_age_16p_rs +util_child1_age_10to15_rs,Child 1 age 10 to 15 years - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 9) & (age_child1 < 16),coef_child_age_10to15_rs +util_child2_age_10to15_rs,Child 2 age 10 to 15 years - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 9) & (age_child2 < 16),coef_child_age_10to15_rs +util_child3_age_10to15_rs,Child 3 age 10 to 15 years - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 9) & (age_child3 < 16),coef_child_age_10to15_rs +util_child1_age_6to9_rs,Child 1 age 6 to 9 years - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 5) & (age_child1 < 10),coef_child_age_6to9_rs +util_child2_age_6to9_rs,Child 2 age 6 to 9 years - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 5) & (age_child2 < 10),coef_child_age_6to9_rs +util_child3_age_6to9_rs,Child 3 age 6 to 9 years - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 5) & (age_child3 < 10),coef_child_age_6to9_rs +util_child1_age_u6_rs,Child 1 age under 6 years old - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 < 6),coef_child_age_u6_rs +util_child2_age_u6_rs,Child 2 age under 6 years old - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 < 6),coef_child_age_u6_rs +util_child3_age_u6_rs,Child 3 age under 6 years old - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 < 6),coef_child_age_u6_rs +# ,Pure Escort Distance,, +util_child1_dist_pe,Child 1 Pure escorting not allowed if over 30 miles,((chauf1 == 2) | (chauf1 == 4)) & (dist_school_to_home1 > 30),coef_unavail +util_child2_dist_pe,Child 2 Pure escorting not allowed if over 30 miles,((chauf2 == 2) | (chauf2 == 4)) & (dist_school_to_home2 > 30),coef_unavail +util_child3_dist_pe,Child 3 Pure escorting not allowed if over 30 miles,((chauf3 == 2) | (chauf3 == 4)) & (dist_school_to_home3 > 30),coef_unavail +# ,Household Interactions,, +util_hh_inc_u25k_noes,Household income less than 25k - No Escorting,(income <= 25000) & ((bundle1 == 0) | ((bundle2 == 0) & (num_children_going_to_school > 1)) | ((bundle3 == 0) & (num_children_going_to_school > 2))),coef_hh_inc_u25k_noes +util_hh_inc_25to50k_noes,Household income between 25 and 50k - No Escorting,((income > 25000) & (income <= 50000)) & ((bundle1 == 0) | ((bundle2 == 0) & (num_children_going_to_school > 1)) | ((bundle3 == 0) & (num_children_going_to_school > 2))),coef_hh_inc_25to50k_noes +util_zero_auto_hh_noes,Zero cars in the household - No Escorting,(auto_ownership == 0) & ((bundle1 == 0) | ((bundle2 == 0) & (num_children_going_to_school > 1)) | ((bundle3 == 0) & (num_children_going_to_school > 2))),coef_zero_auto_hh_noes +util_cars_lt_workers_rs,Cars fewer than household workers - Ride Share,(auto_ownership < num_workers) & ((chauf1 % 2 == 1) | (chauf2 % 2 == 1) | (chauf3 % 2 == 1)),coef_cars_lt_workers_rs +util_cars_lt_workers_pe,Cars fewer than household workers - Pure escort,(auto_ownership < num_workers) & ((chauf1 % 2 == 0) | (chauf2 % 2 == 0) | (chauf3 % 2 == 0)),coef_cars_lt_workers_pe +# ,Chauffer Interactions,, +util_chauf1_female_rs,Chauffeur 1 Female - Ride share,(gender_chauf1 == 2) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_female_rs +util_chauf1_male_rs,Chauffeur 1 Male - Ride share,(gender_chauf1 == 1) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_male_rs +util_chauf1_female_pe,Chauffeur 1 Female - Pure Escort,(gender_chauf1 == 2) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_female_pe +util_chauf1_male_pe,Chauffeur 1 Male - Pure Escort,(gender_chauf1 == 1) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_male_pe +util_chauf2_female_rs,Chauffeur 2 Female - Ride share,(gender_chauf2 == 2) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_female_rs +util_chauf2_male_rs,Chauffeur 2 Male - Ride share,(gender_chauf2 == 1) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_male_rs +util_chauf2_female_pe,Chauffeur 2 Female - Pure Escort,(gender_chauf2 == 2) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_female_pe +util_chauf2_male_pe,Chauffeur 2 Male - Pure Escort,(gender_chauf2 == 1) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_male_pe +util_chauf1_pt_worker_rs,Chauffer 1 part time worker - Ride share,(ptype_chauf1 == 2) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_pt_worker_rs +util_chauf1_pt_worker_pe,Chauffer 1 part time worker - Pure escort,(ptype_chauf1 == 2) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_pt_worker_pe +util_chauf2_pt_worker_rs,Chauffer 2 part time worker - Ride share,(ptype_chauf2 == 2) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_pt_worker_rs +util_chauf2_pt_worker_pe,Chauffer 2 part time worker - Pure escort,(ptype_chauf2 == 2) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_pt_worker_pe +util_chauf1_non_worker_pe,Chauffer 1 non worker - Pure escort,(ptype_chauf1 == 4) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_non_worker_pe +util_chauf2_non_worker_pe,Chauffer 2 non worker - Pure escort,(ptype_chauf2 == 4) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_non_worker_pe +util_chauf1_univ_stud_re,Chauffer 1 university student - Ride Share,(ptype_chauf1 == 3) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_univ_stud_re +util_chauf2_univ_stud_re,Chauffer 2 university student - Ride Share,(ptype_chauf2 == 3) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_univ_stud_re +util_chauf1_age_u35_pe,Chauffer 1 Age 35 years or younger - Pure escort,(ptype_chauf1 == 4) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_age_u35_pe +util_chauf2_age_u35_pe,Chauffer 2 Age 35 years or younger - Pure escort,(ptype_chauf2 == 4) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_age_u35_pe +util_chauf1_time_to_work_or_univ_rs,Chauffer 1 Auto time to work or university - Ride Share,time_mand_to_home1 * ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_time_to_work_or_univ_rs +util_chauf2_time_to_work_or_univ_rs,Chauffer 2 Auto time to work or university - Ride Share,time_mand_to_home2 * ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_time_to_work_or_univ_rs +util_chauf1_walk_dist_to_work_or_univ_rs,Chauffer 1 Walk dist to work or university - Ride Share,(dist_mand1_to_home < 3) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_walk_dist_to_work_or_univ_rs +util_chauf2_walk_dist_to_work_or_univ_rs,Chauffer 2 Walk dist to work or university - Ride Share,(dist_mand2_to_home < 3) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_walk_dist_to_work_or_univ_rs +util_chauf1_walk_dist_to_work_or_univ_pe,Chauffer 1 Walk dist to work or university - Pure Escort,(dist_home_to_mand1 < 3) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_walk_dist_to_work_or_univ_pe +util_chauf2_walk_dist_to_work_or_univ_pe,Chauffer 2 Walk dist to work or university - Pure Escort,(dist_home_to_mand2 < 3) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_walk_dist_to_work_or_univ_pe +# ,Chauffer deviation,, +util_chauf1_abs_dev_rs_child1only,Chauffer 1 Absolute deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_in_child1_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child1only,Chauffer 2 Absolute deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_in_child1_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child2only,Chauffer 1 Absolute deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 1)) * abs_dev_dist_in_child2_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child2only,Chauffer 2 Absolute deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 3)) * abs_dev_dist_in_child2_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child3only,Chauffer 1 Absolute deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 1)) * abs_dev_dist_in_child3_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child3only,Chauffer 2 Absolute deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 3)) * abs_dev_dist_in_child3_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child12,Chauffer 1 Absolute deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_in_child12_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child12,Chauffer 2 Absolute deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_in_child12_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child13,Chauffer 1 Absolute deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 1)) * abs_dev_dist_in_child13_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child13,Chauffer 2 Absolute deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 3)) * abs_dev_dist_in_child13_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child23,Chauffer 1 Absolute deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 1)) * abs_dev_dist_in_child23_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child23,Chauffer 2 Absolute deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 3)) * abs_dev_dist_in_child23_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child123,Chauffer 1 Absolute deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 1)) * abs_dev_dist_in_child123_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child123,Chauffer 2 Absolute deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 3)) * abs_dev_dist_in_child123_chauf2,coef_abs_dev_distance +util_chauf1_rel_dev_rs_child1only,Chauffer 1 Relative deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_in_child1_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child1only,Chauffer 2 Relative deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_in_child1_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child2only,Chauffer 1 Relative deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 1)) * abs_dev_dist_in_child2_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child2only,Chauffer 2 Relative deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 3)) * abs_dev_dist_in_child2_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child3only,Chauffer 1 Relative deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 1)) * abs_dev_dist_in_child3_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child3only,Chauffer 2 Relative deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 3)) * abs_dev_dist_in_child3_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child12,Chauffer 1 Relative deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_in_child12_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child12,Chauffer 2 Relative deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_in_child12_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child13,Chauffer 1 Relative deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 1)) * abs_dev_dist_in_child13_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child13,Chauffer 2 Relative deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 3)) * abs_dev_dist_in_child13_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child23,Chauffer 1 Relative deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 1)) * abs_dev_dist_in_child23_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child23,Chauffer 2 Relative deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 3)) * abs_dev_dist_in_child23_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child123,Chauffer 1 Relative deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 1)) * abs_dev_dist_in_child123_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child123,Chauffer 2 Relative deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 3)) * abs_dev_dist_in_child123_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +# ,Same TAZ,, +util_same_taz_child12_escort,Same school TAZ for child 1 and 2 - Escorting,(bundle1 == bundle2) & (bundle1 > 0) & (school_location_child1 == school_location_child2) & (school_location_child1 > 0),coef_same_taz_escort +util_same_taz_child13_escort,Same school TAZ for child 1 and 3 - Escorting,(bundle1 == bundle3) & (bundle1 > 0) & (school_location_child1 == school_location_child3) & (school_location_child1 > 0),coef_same_taz_escort +util_same_taz_child32_escort,Same school TAZ for child 3 and 2 - Escorting,(bundle3 == bundle2) & (bundle2 > 0) & (school_location_child3 == school_location_child2) & (school_location_child2 > 0),coef_same_taz_escort +util_same_taz_child12_no_escort,Same school TAZ for child 1 and 2 - No Escorting,(bundle1 == 0) & (bundle2 == 0) & (child_id1 > 0) & (child_id2 > 0) & (school_location_child1 == school_location_child2) & (school_location_child1 > 0),coef_same_taz_no_escort +util_same_taz_child13_no_escort,Same school TAZ for child 1 and 3 - No Escorting,(bundle1 == 0) & (bundle3 == 0) & (child_id1 > 0) & (child_id3 > 0) & (school_location_child1 == school_location_child3) & (school_location_child1 > 0),coef_same_taz_no_escort +util_same_taz_child32_no_escort,Same school TAZ for child 3 and 2 - No Escorting,(bundle3 == 0) & (bundle2 == 0) & (child_id3 > 0) & (child_id2 > 0) & (school_location_child3 == school_location_child2) & (school_location_child2 > 0),coef_same_taz_no_escort +# ,Outbound Terms,, +util_no_escort_outbound_child1,No escorting in outbound direction - Child 1,(bundle1 == 0) & (child_id1 > 0) & (bundle1_outbound == 0),coef_no_escort_outbound +util_no_escort_outbound_child2,No escorting in outbound direction - Child 2,(bundle2 == 0) & (child_id2 > 0) & (bundle2_outbound == 0),coef_no_escort_outbound +util_no_escort_outbound_child3,No escorting in outbound direction - Child 3,(bundle3 == 0) & (child_id3 > 0) & (bundle3_outbound == 0),coef_no_escort_outbound +util_outbound_rs_child1,Ride sharing in the outbound direction - Child 1,((chauf1 == 1) | (chauf1 == 3)) & ((chauf1_outbound == 1) | (chauf1_outbound == 3)),coef_outbound_rs +util_outbound_rs_child1,Ride sharing in the outbound direction - Child 2,((chauf2 == 1) | (chauf2 == 3)) & ((chauf2_outbound == 1) | (chauf2_outbound == 3)),coef_outbound_rs +util_outbound_rs_child1,Ride sharing in the outbound direction - Child 3,((chauf3 == 1) | (chauf3 == 3)) & ((chauf3_outbound == 1) | (chauf3_outbound == 3)),coef_outbound_rs +util_same_chauf,Same chauffeur in both directions (not child specific) - chauf 1 inbound & outbound,((chauf1 == 1) | (chauf1 == 2) | (chauf2 == 1) | (chauf2 == 2) | (chauf3 == 1) | (chauf3 == 2)) & ((nbund1_outbound > 0)),coef_same_chauf +util_same_chauf,Same chauffeur in both directions (not child specific) - chauf 2 inbound & outbound,((chauf1 == 3) | (chauf1 == 4) | (chauf2 == 3) | (chauf2 == 4) | (chauf3 == 3) | (chauf3 == 4)) & ((nbund2_outbound > 0)),coef_same_chauf +# ,Calibration Constants,, +util_calib_child1_age_u6_rs,Child 1 age under 6 - Calibration constant - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 < 6),coef_calib_child_age_u6_rs +util_calib_child2_age_u6_rs,Child 2 age under 6 - Calibration constant - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 < 6),coef_calib_child_age_u6_rs +util_calib_child3_age_u6_rs,Child 3 age under 6 - Calibration constant - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 < 6),coef_calib_child_age_u6_rs +util_calib_child1_age_16p_rs,Child 1 age 16 years or older - Calibration constant - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 15),coef_calib_child_age_16p_rs +util_calib_child2_age_16p_rs,Child 2 age 16 years or older - Calibration constant - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 15),coef_calib_child_age_16p_rs +util_calib_child3_age_16p_rs,Child 3 age 16 years or older - Calibration constant - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 15),coef_calib_child_age_16p_rs +util_calib_child1_age_6to15_noes,Child 1 age 6 to 15 years - Calibration constant - No Escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 > 5) & (age_child1 < 16),coef_calib_child_age_6to15_noes +util_calib_child2_age_6to15_noes,Child 2 age 6 to 15 years - Calibration constant - No Escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 > 5) & (age_child2 < 16),coef_calib_child_age_6to15_noes +util_calib_child3_age_6to15_noes,Child 3 age 6 to 15 years - Calibration constant - No Escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 > 5) & (age_child3 < 16),coef_calib_child_age_6to15_noes +util_calib_child1_age_u6_noes,Child 1 age 5 years or younger - Calibration constant - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 < 6),coef_calib_child_age_u6_noes +util_calib_child2_age_u6_noes,Child 2 age 5 years or younger - Calibration constant - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 < 6),coef_calib_child_age_u6_noes +util_calib_child3_age_u6_noes,Child 3 age 5 years or younger - Calibration constant - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 < 6),coef_calib_child_age_u6_noes +util_calib_child1_age_6to15_rs,Child 1 age 6 to 15 years - Calibration constant - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 5) & (age_child1 < 16),coef_calib_child_age_6to15_rs +util_calib_child2_age_6to15_rs,Child 2 age 6 to 15 years - Calibration constant - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 5) & (age_child2 < 16),coef_calib_child_age_6to15_rs +util_calib_child3_age_6to15_rs,Child 3 age 6 to 15 years - Calibration constant - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 5) & (age_child3 < 16),coef_calib_child_age_6to15_rs diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_outbound.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_outbound.csv new file mode 100644 index 0000000000..53f5f4ccbe --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_outbound.csv @@ -0,0 +1,163 @@ +Label,Description,Expression,Coefficient +# ,Availability Conditions,, +util_one_child_to_school,Availability based on number of eligible children,((bundle2 + bundle3) > 0) & (num_children_going_to_school==1),coef_unavail +util_two_children_to_school,Availability based on number of eligible children,(bundle3 > 0) & (num_children_going_to_school == 2),coef_unavail +util_one_potential_chauffeur,Availability based on number of eligible chauffeurs,((bundle1 + bundle2 + bundle3) > 0) & (num_potential_chauffeurs == 0),coef_unavail +util_two_potential_chauffeurs,Availability based on number of eligible chauffeurs,((chauf1 > 2) | (chauf2 > 2) | (chauf3 > 2)) & (num_potential_chauffeurs == 1),coef_unavail +util_avail_rs_cdap_child1_chauf1,Availability for RideSharing by daily pattern - Child 1 and Chauffeur 1,(bundle1 > 0) & (chauf1 == 1) & (cdap_chauf1 != 'M'),coef_unavail +util_avail_rs_cdap_child1_chauf2,Availability for RideSharing by daily pattern - Child 1 and Chauffeur 2,(bundle1 > 0) & (chauf1 == 3) & (cdap_chauf2 != 'M'),coef_unavail +util_avail_rs_cdap_child2_chauf1,Availability for RideSharing by daily pattern - Child 2 and Chauffeur 1,(bundle2 > 0) & (chauf2 == 1) & (cdap_chauf1 != 'M'),coef_unavail +util_avail_rs_cdap_child2_chauf2,Availability for RideSharing by daily pattern - Child 2 and Chauffeur 2,(bundle2 > 0) & (chauf2 == 3) & (cdap_chauf2 != 'M'),coef_unavail +util_avail_rs_cdap_child3_chauf1,Availability for RideSharing by daily pattern - Child 3 and Chauffeur 1,(bundle3 > 0) & (chauf3 == 1) & (cdap_chauf1 != 'M'),coef_unavail +util_avail_rs_cdap_child3_chauf2,Availability for RideSharing by daily pattern - Child 3 and Chauffeur 2,(bundle3 > 0) & (chauf3 == 3) & (cdap_chauf2 != 'M'),coef_unavail +util_avail_rs_sync_child1_chauf1,Availability for RideSharing by synchronization - Child 1 and Chauffeur 1,@(df.bundle1 > 0) & (df.chauf1 == 1) & (df.pref_depart_time_chauf1 > 0) & (np.abs(df.pref_depart_time_chauf1 - df.pref_depart_time_school1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child1_chauf2,Availability for RideSharing by synchronization - Child 1 and Chauffeur 2,@(df.bundle1 > 0) & (df.chauf1 == 3) & (df.pref_depart_time_chauf2 > 0) & (np.abs(df.pref_depart_time_chauf2 - df.pref_depart_time_school1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child2_chauf1,Availability for RideSharing by synchronization - Child 2 and Chauffeur 1,@(df.bundle2 > 0) & (df.chauf2 == 1) & (df.pref_depart_time_chauf1 > 0) & (np.abs(df.pref_depart_time_chauf1 - df.pref_depart_time_school2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child2_chauf2,Availability for RideSharing by synchronization - Child 2 and Chauffeur 2,@(df.bundle2 > 0) & (df.chauf2 == 3) & (df.pref_depart_time_chauf2 > 0) & (np.abs(df.pref_depart_time_chauf2 - df.pref_depart_time_school2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child3_chauf1,Availability for RideSharing by synchronization - Child 3 and Chauffeur 1,@(df.bundle3 > 0) & (df.chauf3 == 1) & (df.pref_depart_time_chauf1 > 0) & (np.abs(df.pref_depart_time_chauf1 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child3_chauf2,Availability for RideSharing by synchronization - Child 3 and Chauffeur 2,@(df.bundle3 > 0) & (df.chauf3 == 3) & (df.pref_depart_time_chauf2 > 0) & (np.abs(df.pref_depart_time_chauf2 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_cdap_child1_chauf1,Availability for Pure-Escorting by daily pattern - Child 1 and Chauffeur 1,(bundle1 > 0) & (chauf1 == 2) & (ptype_chauf1 < 6) & (cdap_chauf1 == 'H'),coef_unavail +util_avail_pe_cdap_child1_chauf2,Availability for Pure-Escorting by daily pattern - Child 1 and Chauffeur 2,(bundle1 > 0) & (chauf1 == 4) & (ptype_chauf2 < 6) & (cdap_chauf2 == 'H'),coef_unavail +util_avail_pe_cdap_child2_chauf1,Availability for Pure-Escorting by daily pattern - Child 2 and Chauffeur 1,(bundle2 > 0) & (chauf2 == 2) & (ptype_chauf1 < 6) & (cdap_chauf1 == 'H'),coef_unavail +util_avail_pe_cdap_child2_chauf2,Availability for Pure-Escorting by daily pattern - Child 2 and Chauffeur 2,(bundle2 > 0) & (chauf2 == 4) & (ptype_chauf2 < 6) & (cdap_chauf2 == 'H'),coef_unavail +util_avail_pe_cdap_child3_chauf1,Availability for Pure-Escorting by daily pattern - Child 3 and Chauffeur 1,(bundle3 > 0) & (chauf3 == 2) & (ptype_chauf1 < 6) & (cdap_chauf1 == 'H'),coef_unavail +util_avail_pe_cdap_child3_chauf2,Availability for Pure-Escorting by daily pattern - Child 3 and Chauffeur 2,(bundle3 > 0) & (chauf3 == 4) & (ptype_chauf2 < 6) & (cdap_chauf2 == 'H'),coef_unavail +util_avail_pe_sync_child1_chauf1,Availability for Pure-Escorting by synchronization - Child 1 and Chauffeur 1,@(df.bundle1 > 0) & (df.chauf1 == 2) & (df.ptype_chauf1 < 4) & (df.cdap_chauf1 == 'H') & (np.abs(df.pref_depart_time_school1 + ((df.time_home_to_school1 + df.time_school_to_home1) / mins_per_time_bin) - df.pref_depart_time_chauf1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child1_chauf2,Availability for Pure-Escorting by synchronization - Child 1 and Chauffeur 2,@(df.bundle1 > 0) & (df.chauf1 == 4) & (df.ptype_chauf2 < 4) & (df.cdap_chauf2 == 'H') & (np.abs(df.pref_depart_time_school1 + ((df.time_home_to_school1 + df.time_school_to_home1) / mins_per_time_bin) - df.pref_depart_time_chauf2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child2_chauf1,Availability for Pure-Escorting by synchronization - Child 2 and Chauffeur 1,@(df.bundle2 > 0) & (df.chauf2 == 2) & (df.ptype_chauf1 < 4) & (df.cdap_chauf1 == 'H') & (np.abs(df.pref_depart_time_school2 + ((df.time_home_to_school2 + df.time_school_to_home2) / mins_per_time_bin) - df.pref_depart_time_chauf1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child2_chauf2,Availability for Pure-Escorting by synchronization - Child 2 and Chauffeur 2,@(df.bundle2 > 0) & (df.chauf2 == 4) & (df.ptype_chauf2 < 4) & (df.cdap_chauf2 == 'H') & (np.abs(df.pref_depart_time_school2 + ((df.time_home_to_school2 + df.time_school_to_home2) / mins_per_time_bin) - df.pref_depart_time_chauf2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child3_chauf1,Availability for Pure-Escorting by synchronization - Child 3 and Chauffeur 1,@(df.bundle3 > 0) & (df.chauf3 == 2) & (df.ptype_chauf1 < 4) & (df.cdap_chauf1 == 'H') & (np.abs(df.pref_depart_time_school3 + ((df.time_home_to_school3 + df.time_school_to_home3) / mins_per_time_bin) - df.pref_depart_time_chauf1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child3_chauf2,Availability for Pure-Escorting by synchronization - Child 3 and Chauffeur 2,@(df.bundle3 > 0) & (df.chauf3 == 4) & (df.ptype_chauf2 < 4) & (df.cdap_chauf2 == 'H') & (np.abs(df.pref_depart_time_school3 + ((df.time_home_to_school3 + df.time_school_to_home3) / mins_per_time_bin) - df.pref_depart_time_chauf2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_bundle_child_1and2,Availability for bundling child 1 and child 2,@(df.bundle1 == df.bundle2) & (df.bundle1 > 0) & (np.abs(df.pref_depart_time_school1 - df.pref_depart_time_school2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_bundle_child_1and3,Availability for bundling child 1 and child 3,@(df.bundle1 == df.bundle3) & (df.bundle1 > 0) & (np.abs(df.pref_depart_time_school1 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_bundle_child_2and3,Availability for bundling child 2 and child 3,@(df.bundle2 == df.bundle3) & (df.bundle2 > 0) & (np.abs(df.pref_depart_time_school2 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_mult_bundles_outbound1,Availability Chauffeur 1 - Expected arrival from previous pure escort must be before departure for subsequent escort,((nrs1 + npe1) > 1) & ~avail_multiple_bundles,coef_unavail +util_avail_mult_bundles_outbound2,Availability Chauffeur 2 - Expected arrival from previous pure escort must be before departure for subsequent escort,((nrs2 + npe2) > 1) & ~avail_multiple_bundles,coef_unavail +util_avail_pe_during_mand_child1_chauf1,Availability pure escort tour must take place before mandatory tour - Child 1 and Chauffeur 1,@(df.bundle1 > 0) & (df.chauf1 == 2) & (df.cdap_chauf1 == 'M') & ((df.pref_depart_time_chauf1 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school1),coef_unavail +util_avail_pe_during_mand_child1_chauf2,Availability pure escort tour must take place before mandatory tour - Child 1 and Chauffeur 2,@(df.bundle1 > 0) & (df.chauf1 == 4) & (df.cdap_chauf2 == 'M') & ((df.pref_depart_time_chauf2 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school1),coef_unavail +util_avail_pe_during_mand_child2_chauf1,Availability pure escort tour must take place before mandatory tour - Child 2 and Chauffeur 1,@(df.bundle2 > 0) & (df.chauf2 == 2) & (df.cdap_chauf1 == 'M') & ((df.pref_depart_time_chauf1 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school2),coef_unavail +util_avail_pe_during_mand_child2_chauf2,Availability pure escort tour must take place before mandatory tour - Child 2 and Chauffeur 2,@(df.bundle2 > 0) & (df.chauf2 == 4) & (df.cdap_chauf2 == 'M') & ((df.pref_depart_time_chauf2 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school2),coef_unavail +util_avail_pe_during_mand_child3_chauf1,Availability pure escort tour must take place before mandatory tour - Child 3 and Chauffeur 1,@(df.bundle3 > 0) & (df.chauf3 == 2) & (df.cdap_chauf1 == 'M') & ((df.pref_depart_time_chauf1 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school3),coef_unavail +util_avail_pe_during_mand_child3_chauf2,Availability pure escort tour must take place before mandatory tour - Child 3 and Chauffeur 2,@(df.bundle3 > 0) & (df.chauf3 == 4) & (df.cdap_chauf2 == 'M') & ((df.pref_depart_time_chauf2 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school3),coef_unavail +# ,No escorting,, +util_child1_age_16p_noes,Child 1 age 16 years or older - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 > 15),coef_child_age_16p_noes +util_child2_age_16p_noes,Child 2 age 16 years or older - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 > 15),coef_child_age_16p_noes +util_child3_age_16p_noes,Child 3 age 16 years or older - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 > 15),coef_child_age_16p_noes +util_child1_age_10_to_15_noes,Child 1 age 10 to 15 years - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 > 9) & (age_child1 < 16),coef_child_age_10_to_15_noes +util_child2_age_10_to_15_noes,Child 2 age 10 to 15 years - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 > 9) & (age_child2 < 16),coef_child_age_10_to_15_noes +util_child3_age_10_to_15_noes,Child 3 age 10 to 15 years - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 > 9) & (age_child3 < 16),coef_child_age_10_to_15_noes +util_child1_age_u9_noes,Child 1 age 9 years or younger - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 < 10),coef_child_age_u9_noes +util_child2_age_u9_noes,Child 2 age 9 years or younger - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 < 10),coef_child_age_u9_noes +util_child3_age_u9_noes,Child 3 age 9 years or younger - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 < 10),coef_child_age_u9_noes +util_ln_dist_to_school_child1_noes,Logged distance to school for Child 1 - No escort,@(df.bundle1 == 0) * (df.child_id1 > 0) * np.log(1 + df.dist_home_to_school1),coef_ln_dist_to_school_noes +util_ln_dist_to_school_child2_noes,Logged distance to school for Child 2 - No escort,@(df.bundle2 == 0) * (df.child_id2 > 0) * np.log(1 + df.dist_home_to_school2),coef_ln_dist_to_school_noes +util_ln_dist_to_school_child3_noes,Logged distance to school for Child 3 - No escort,@(df.bundle3 == 0) * (df.child_id3 > 0) * np.log(1 + df.dist_home_to_school3),coef_ln_dist_to_school_noes +util_ln_dist_to_school_child1_u6_noes,Logged distance to school for Child 1 under 6 years old - No escort,@(df.bundle1 == 0) * (df.child_id1 > 0) * (df.age_child1 < 6) * np.log(1 + df.dist_home_to_school1),coef_ln_dist_to_school_u6_noes +util_ln_dist_to_school_child2_u6_noes,Logged distance to school for Child 2 under 6 years old - No escort,@(df.bundle2 == 0) * (df.child_id2 > 0) * (df.age_child2 < 6) * np.log(1 + df.dist_home_to_school2),coef_ln_dist_to_school_u6_noes +util_ln_dist_to_school_child3_u6_noes,Logged distance to school for Child 3 under 6 years old - No escort,@(df.bundle3 == 0) * (df.child_id3 > 0) * (df.age_child3 < 6) * np.log(1 + df.dist_home_to_school3),coef_ln_dist_to_school_u6_noes +util_ln_dist_to_school_child1_6to9_noes,Logged distance to school for Child 1 6 to 9 years old - No escort,@(df.bundle1 == 0) * (df.child_id1 > 0) * (df.age_child1 > 5) * (df.age_child1 < 10) * np.log(1 + df.dist_home_to_school1),coef_ln_dist_to_school_6to9_noes +util_ln_dist_to_school_child2_6to9_noes,Logged distance to school for Child 2 6 to 9 years old - No escort,@(df.bundle2 == 0) * (df.child_id2 > 0) * (df.age_child2 > 5) * (df.age_child2 < 10) * np.log(1 + df.dist_home_to_school2),coef_ln_dist_to_school_6to9_noes +util_ln_dist_to_school_child3_6to9_noes,Logged distance to school for Child 3 6 to 9 years old - No escort,@(df.bundle3 == 0) * (df.child_id3 > 0) * (df.age_child3 > 5) * (df.age_child3 < 10) * np.log(1 + df.dist_home_to_school3),coef_ln_dist_to_school_6to9_noes +# ,Ride Sharing,, +util_child1_age_16p_rs,Child 1 age 16 years or older - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 15),coef_child_age_16p_rs +util_child2_age_16p_rs,Child 2 age 16 years or older - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 15),coef_child_age_16p_rs +util_child3_age_16p_rs,Child 3 age 16 years or older - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 15),coef_child_age_16p_rs +util_child1_age_10to15_rs,Child 1 age 10 to 15 years - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 9) & (age_child1 < 16),coef_child_age_10to15_rs +util_child2_age_10to15_rs,Child 2 age 10 to 15 years - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 9) & (age_child2 < 16),coef_child_age_10to15_rs +util_child3_age_10to15_rs,Child 3 age 10 to 15 years - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 9) & (age_child3 < 16),coef_child_age_10to15_rs +util_child1_age_6to9_rs,Child 1 age 6 to 9 years - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 5) & (age_child1 < 10),coef_child_age_6to9_rs +util_child2_age_6to9_rs,Child 2 age 6 to 9 years - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 5) & (age_child2 < 10),coef_child_age_6to9_rs +util_child3_age_6to9_rs,Child 3 age 6 to 9 years - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 5) & (age_child3 < 10),coef_child_age_6to9_rs +util_child1_age_u6_rs,Child 1 age under 6 years old - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 < 6),coef_child_age_u6_rs +util_child2_age_u6_rs,Child 2 age under 6 years old - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 < 6),coef_child_age_u6_rs +util_child3_age_u6_rs,Child 3 age under 6 years old - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 < 6),coef_child_age_u6_rs +# ,Pure Escort Distance,, +util_child1_dist_pe,Child 1 distance to school - Pure escorting,((chauf1 == 2) | (chauf1 == 4)) * dist_home_to_school1,coef_child_dist_pe +util_child2_dist_pe,Child 2 distance to school - Pure escorting,((chauf2 == 2) | (chauf2 == 4)) * dist_home_to_school2,coef_child_dist_pe +util_child3_dist_pe,Child 3 distance to school - Pure escorting,((chauf3 == 2) | (chauf3 == 4)) * dist_home_to_school3,coef_child_dist_pe +util_child1_dist_pe,Child 1 Pure escorting not allowed if over 30 miles,((chauf1 == 2) | (chauf1 == 4)) & (dist_home_to_school1 > 30),coef_unavail +util_child2_dist_pe,Child 2 Pure escorting not allowed if over 30 miles,((chauf2 == 2) | (chauf2 == 4)) & (dist_home_to_school2 > 30),coef_unavail +util_child3_dist_pe,Child 3 Pure escorting not allowed if over 30 miles,((chauf3 == 2) | (chauf3 == 4)) & (dist_home_to_school3 > 30),coef_unavail +# ,Household Interactions,, +util_hh_inc_u25k_noes,Household income less than 25k - No Escorting,(income <= 25000) & ((bundle1 == 0) | ((bundle2 == 0) & (num_children_going_to_school > 1)) | ((bundle3 == 0) & (num_children_going_to_school > 2))),coef_hh_inc_u25k_noes +util_hh_inc_25to50k_noes,Household income between 25 and 50k - No Escorting,((income > 25000) & (income <= 50000)) & ((bundle1 == 0) | ((bundle2 == 0) & (num_children_going_to_school > 1)) | ((bundle3 == 0) & (num_children_going_to_school > 2))),coef_hh_inc_25to50k_noes +util_zero_auto_hh_noes,Zero cars in the household - No Escorting,(auto_ownership == 0) & ((bundle1 == 0) | ((bundle2 == 0) & (num_children_going_to_school > 1)) | ((bundle3 == 0) & (num_children_going_to_school > 2))),coef_zero_auto_hh_noes +util_cars_lt_workers_rs,Cars fewer than household workers - Ride Share,(auto_ownership < num_workers) & ((chauf1 % 2 == 1) | (chauf2 % 2 == 1) | (chauf3 % 2 == 1)),coef_cars_lt_workers_rs +util_cars_lt_workers_pe,Cars fewer than household workers - Pure escort,(auto_ownership < num_workers) & ((chauf1 % 2 == 0) | (chauf2 % 2 == 0) | (chauf3 % 2 == 0)),coef_cars_lt_workers_pe +# ,Chauffer Interactions,, +util_chauf1_female_rs,Chauffeur 1 Female - Ride share,(gender_chauf1 == 2) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_female_rs +util_chauf1_male_rs,Chauffeur 1 Male - Ride share,(gender_chauf1 == 1) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_male_rs +util_chauf1_female_pe,Chauffeur 1 Female - Pure Escort,(gender_chauf1 == 2) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_female_pe +util_chauf1_male_pe,Chauffeur 1 Male - Pure Escort,(gender_chauf1 == 1) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_male_pe +util_chauf2_female_rs,Chauffeur 2 Female - Ride share,(gender_chauf2 == 2) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_female_rs +util_chauf2_male_rs,Chauffeur 2 Male - Ride share,(gender_chauf2 == 1) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_male_rs +util_chauf2_female_pe,Chauffeur 2 Female - Pure Escort,(gender_chauf2 == 2) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_female_pe +util_chauf2_male_pe,Chauffeur 2 Male - Pure Escort,(gender_chauf2 == 1) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_male_pe +util_chauf1_pt_worker_rs,Chauffer 1 part time worker - Ride share,(ptype_chauf1 == 2) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_pt_worker_rs +util_chauf1_pt_worker_pe,Chauffer 1 part time worker - Pure escort,(ptype_chauf1 == 2) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_pt_worker_pe +util_chauf2_pt_worker_rs,Chauffer 2 part time worker - Ride share,(ptype_chauf2 == 2) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_pt_worker_rs +util_chauf2_pt_worker_pe,Chauffer 2 part time worker - Pure escort,(ptype_chauf2 == 2) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_pt_worker_pe +util_chauf1_non_worker_pe,Chauffer 1 non worker - Pure escort,(ptype_chauf1 == 4) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_non_worker_pe +util_chauf2_non_worker_pe,Chauffer 2 non worker - Pure escort,(ptype_chauf2 == 4) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_non_worker_pe +util_chauf1_univ_stud_re,Chauffer 1 university student - Ride Share,(ptype_chauf1 == 3) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_univ_stud_re +util_chauf2_univ_stud_re,Chauffer 2 university student - Ride Share,(ptype_chauf2 == 3) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_univ_stud_re +util_chauf1_age_u35_pe,Chauffer 1 Age 35 years or younger - Pure escort,(ptype_chauf1 == 4) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_age_u35_pe +util_chauf2_age_u35_pe,Chauffer 2 Age 35 years or younger - Pure escort,(ptype_chauf2 == 4) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_age_u35_pe +util_chauf1_time_to_work_or_univ_rs,Chauffer 1 Auto time to work or university - Ride Share,time_home_to_mand1 * ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_time_to_work_or_univ_rs +util_chauf2_time_to_work_or_univ_rs,Chauffer 2 Auto time to work or university - Ride Share,time_home_to_mand2 * ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_time_to_work_or_univ_rs +util_chauf1_walk_dist_to_work_or_univ_rs,Chauffer 1 Walk dist to work or university - Ride Share,(dist_home_to_mand1 < 3) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_walk_dist_to_work_or_univ_rs +util_chauf2_walk_dist_to_work_or_univ_rs,Chauffer 2 Walk dist to work or university - Ride Share,(dist_home_to_mand2 < 3) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_walk_dist_to_work_or_univ_rs +util_chauf1_walk_dist_to_work_or_univ_pe,Chauffer 1 Walk dist to work or university - Pure Escort,(dist_home_to_mand1 < 3) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_walk_dist_to_work_or_univ_pe +util_chauf2_walk_dist_to_work_or_univ_pe,Chauffer 2 Walk dist to work or university - Pure Escort,(dist_home_to_mand2 < 3) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_walk_dist_to_work_or_univ_pe +# ,Chauffer deviation,, +util_chauf1_abs_dev_rs_child1only,Chauffer 1 Absolute deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child1_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child1only,Chauffer 2 Absolute deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child1_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child2only,Chauffer 1 Absolute deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 1)) * abs_dev_dist_out_child2_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child2only,Chauffer 2 Absolute deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 3)) * abs_dev_dist_out_child2_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child3only,Chauffer 1 Absolute deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 1)) * abs_dev_dist_out_child3_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child3only,Chauffer 2 Absolute deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 3)) * abs_dev_dist_out_child3_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child12,Chauffer 1 Absolute deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child12_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child12,Chauffer 2 Absolute deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child12_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child13,Chauffer 1 Absolute deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child13_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child13,Chauffer 2 Absolute deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child13_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child23,Chauffer 1 Absolute deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 1)) * abs_dev_dist_out_child23_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child23,Chauffer 2 Absolute deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 3)) * abs_dev_dist_out_child23_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child123,Chauffer 1 Absolute deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child123_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child123,Chauffer 2 Absolute deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child123_chauf2,coef_abs_dev_distance +util_chauf1_rel_dev_rs_child1only,Chauffer 1 Relative deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child1_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child1only,Chauffer 2 Relative deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child1_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child2only,Chauffer 1 Relative deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 1)) * abs_dev_dist_out_child2_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child2only,Chauffer 2 Relative deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 3)) * abs_dev_dist_out_child2_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child3only,Chauffer 1 Relative deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 1)) * abs_dev_dist_out_child3_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child3only,Chauffer 2 Relative deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 3)) * abs_dev_dist_out_child3_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child12,Chauffer 1 Relative deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child12_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child12,Chauffer 2 Relative deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child12_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child13,Chauffer 1 Relative deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child13_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child13,Chauffer 2 Relative deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child13_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child23,Chauffer 1 Relative deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 1)) * abs_dev_dist_out_child23_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child23,Chauffer 2 Relative deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 3)) * abs_dev_dist_out_child23_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child123,Chauffer 1 Relative deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child123_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child123,Chauffer 2 Relative deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child123_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +# ,Same TAZ,, +util_same_taz_child12_escort,Same school TAZ for child 1 and 2 - Escorting,(bundle1 == bundle2) & (bundle1 > 0) & (school_location_child1 == school_location_child2) & (school_location_child1 > 0),coef_same_taz_escort +util_same_taz_child13_escort,Same school TAZ for child 1 and 3 - Escorting,(bundle1 == bundle3) & (bundle1 > 0) & (school_location_child1 == school_location_child3) & (school_location_child1 > 0),coef_same_taz_escort +util_same_taz_child32_escort,Same school TAZ for child 3 and 2 - Escorting,(bundle3 == bundle2) & (bundle2 > 0) & (school_location_child3 == school_location_child2) & (school_location_child2 > 0),coef_same_taz_escort +util_same_taz_child12_no_escort,Same school TAZ for child 1 and 2 - No Escorting,(bundle1 == 0) & (bundle2 == 0) & (child_id1 > 0) & (child_id2 > 0) & (school_location_child1 == school_location_child2) & (school_location_child1 > 0),coef_same_taz_no_escort +util_same_taz_child13_no_escort,Same school TAZ for child 1 and 3 - No Escorting,(bundle1 == 0) & (bundle3 == 0) & (child_id1 > 0) & (child_id3 > 0) & (school_location_child1 == school_location_child3) & (school_location_child1 > 0),coef_same_taz_no_escort +util_same_taz_child32_no_escort,Same school TAZ for child 3 and 2 - No Escorting,(bundle3 == 0) & (bundle2 == 0) & (child_id3 > 0) & (child_id2 > 0) & (school_location_child3 == school_location_child2) & (school_location_child2 > 0),coef_same_taz_no_escort_23 +# ,Calibration constants,, +util_calib_child1_age_u6_rs,Child 1 age under 6 - Calibration constant - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 < 6),coef_calib_child_age_u6_rs +util_calib_child2_age_u6_rs,Child 2 age under 6 - Calibration constant - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 < 6),coef_calib_child_age_u6_rs +util_calib_child3_age_u6_rs,Child 3 age under 6 - Calibration constant - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 < 6),coef_calib_child_age_u6_rs +util_calib_child1_age_16p_rs,Child 1 age 16 years or older - Calibration constant - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 15),coef_calib_child_age_16p_rs +util_calib_child2_age_16p_rs,Child 2 age 16 years or older - Calibration constant - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 15),coef_calib_child_age_16p_rs +util_calib_child3_age_16p_rs,Child 3 age 16 years or older - Calibration constant - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 15),coef_calib_child_age_16p_rs +util_calib_child1_age_6to15_noes,Child 1 age 6 to 15 years - Calibration constant - No Escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 > 5) & (age_child1 < 16),coef_calib_child_age_6to15_noes +util_calib_child2_age_6to15_noes,Child 2 age 6 to 15 years - Calibration constant - No Escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 > 5) & (age_child2 < 16),coef_calib_child_age_6to15_noes +util_calib_child3_age_6to15_noes,Child 3 age 6 to 15 years - Calibration constant - No Escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 > 5) & (age_child3 < 16),coef_calib_child_age_6to15_noes +util_calib_child1_age_6to15_rs,Child 1 age 6 to 15 years - Calibration constant - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 5) & (age_child1 < 16),coef_calib_child_age_6to15_rs +util_calib_child2_age_6to15_rs,Child 2 age 6 to 15 years - Calibration constant - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 5) & (age_child2 < 16),coef_calib_child_age_6to15_rs +util_calib_child3_age_6to15_rs,Child 3 age 6 to 15 years - Calibration constant - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 5) & (age_child3 < 16),coef_calib_child_age_6to15_rs +util_calib_child1_age_u6_noes,Child 1 age 6 years or younger - Calibration constant - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 < 6),coef_calib_child_age_u6_noes +util_calib_child2_age_u6_noes,Child 2 age 6 years or younger - Calibration constant - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 < 6),coef_calib_child_age_u6_noes +util_calib_child3_age_u6_noes,Child 3 age 6 years or younger - Calibration constant - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 < 6),coef_calib_child_age_u6_noes diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_outbound_cond.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_outbound_cond.csv new file mode 100644 index 0000000000..00527edc36 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_outbound_cond.csv @@ -0,0 +1,169 @@ +Label,Description,Expression,Coefficient +# ,Availability Conditions,, +util_one_child_to_school,Availability based on number of eligible children,((bundle2 + bundle3) > 0) & (num_children_going_to_school==1),coef_unavail +util_two_children_to_school,Availability based on number of eligible children,(bundle3 > 0) & (num_children_going_to_school == 2),coef_unavail +util_one_potential_chauffeur,Availability based on number of eligible chauffeurs,((bundle1 + bundle2 + bundle3) > 0) & (num_potential_chauffeurs == 0),coef_unavail +util_two_potential_chauffeurs,Availability based on number of eligible chauffeurs,((chauf1 > 2) | (chauf2 > 2) | (chauf3 > 2)) & (num_potential_chauffeurs == 1),coef_unavail +util_avail_rs_cdap_child1_chauf1,Availability for RideSharing by daily pattern - Child 1 and Chauffeur 1,(bundle1 > 0) & (chauf1 == 1) & (cdap_chauf1 != 'M'),coef_unavail +util_avail_rs_cdap_child1_chauf2,Availability for RideSharing by daily pattern - Child 1 and Chauffeur 2,(bundle1 > 0) & (chauf1 == 3) & (cdap_chauf2 != 'M'),coef_unavail +util_avail_rs_cdap_child2_chauf1,Availability for RideSharing by daily pattern - Child 2 and Chauffeur 1,(bundle2 > 0) & (chauf2 == 1) & (cdap_chauf1 != 'M'),coef_unavail +util_avail_rs_cdap_child2_chauf2,Availability for RideSharing by daily pattern - Child 2 and Chauffeur 2,(bundle2 > 0) & (chauf2 == 3) & (cdap_chauf2 != 'M'),coef_unavail +util_avail_rs_cdap_child3_chauf1,Availability for RideSharing by daily pattern - Child 3 and Chauffeur 1,(bundle3 > 0) & (chauf3 == 1) & (cdap_chauf1 != 'M'),coef_unavail +util_avail_rs_cdap_child3_chauf2,Availability for RideSharing by daily pattern - Child 3 and Chauffeur 2,(bundle3 > 0) & (chauf3 == 3) & (cdap_chauf2 != 'M'),coef_unavail +util_avail_rs_sync_child1_chauf1,Availability for RideSharing by synchronization - Child 1 and Chauffeur 1,@(df.bundle1 > 0) & (df.chauf1 == 1) & (np.abs(df.pref_depart_time_chauf1 - df.pref_depart_time_school1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child1_chauf2,Availability for RideSharing by synchronization - Child 1 and Chauffeur 2,@(df.bundle1 > 0) & (df.chauf1 == 3) & (np.abs(df.pref_depart_time_chauf2 - df.pref_depart_time_school1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child2_chauf1,Availability for RideSharing by synchronization - Child 2 and Chauffeur 1,@(df.bundle2 > 0) & (df.chauf2 == 1) & (np.abs(df.pref_depart_time_chauf1 - df.pref_depart_time_school2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child2_chauf2,Availability for RideSharing by synchronization - Child 2 and Chauffeur 2,@(df.bundle2 > 0) & (df.chauf2 == 3) & (np.abs(df.pref_depart_time_chauf2 - df.pref_depart_time_school2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child3_chauf1,Availability for RideSharing by synchronization - Child 3 and Chauffeur 1,@(df.bundle3 > 0) & (df.chauf3 == 1) & (np.abs(df.pref_depart_time_chauf1 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_rs_sync_child3_chauf2,Availability for RideSharing by synchronization - Child 3 and Chauffeur 2,@(df.bundle3 > 0) & (df.chauf3 == 3) & (np.abs(df.pref_depart_time_chauf2 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_cdap_child1_chauf1,Availability for Pure-Escorting by daily pattern - Child 1 and Chauffeur 1,(bundle1 > 0) & (chauf1 == 2) & (ptype_chauf1 < 6) & (cdap_chauf1 == 'H'),coef_unavail +util_avail_pe_cdap_child1_chauf2,Availability for Pure-Escorting by daily pattern - Child 1 and Chauffeur 2,(bundle1 > 0) & (chauf1 == 4) & (ptype_chauf2 < 6) & (cdap_chauf2 == 'H'),coef_unavail +util_avail_pe_cdap_child2_chauf1,Availability for Pure-Escorting by daily pattern - Child 2 and Chauffeur 1,(bundle2 > 0) & (chauf2 == 2) & (ptype_chauf1 < 6) & (cdap_chauf1 == 'H'),coef_unavail +util_avail_pe_cdap_child2_chauf2,Availability for Pure-Escorting by daily pattern - Child 2 and Chauffeur 2,(bundle2 > 0) & (chauf2 == 4) & (ptype_chauf2 < 6) & (cdap_chauf2 == 'H'),coef_unavail +util_avail_pe_cdap_child3_chauf1,Availability for Pure-Escorting by daily pattern - Child 3 and Chauffeur 1,(bundle3 > 0) & (chauf3 == 2) & (ptype_chauf1 < 6) & (cdap_chauf1 == 'H'),coef_unavail +util_avail_pe_cdap_child3_chauf2,Availability for Pure-Escorting by daily pattern - Child 3 and Chauffeur 2,(bundle3 > 0) & (chauf3 == 4) & (ptype_chauf2 < 6) & (cdap_chauf2 == 'H'),coef_unavail +util_avail_pe_sync_child1_chauf1,Availability for Pure-Escorting by synchronization - Child 1 and Chauffeur 1,@(df.bundle1 > 0) & (df.chauf1 == 2) & (df.ptype_chauf1 < 4) & (df.cdap_chauf1 == 'H') & (np.abs(df.pref_depart_time_school1 + ((df.time_home_to_school1 + df.time_school_to_home1) / mins_per_time_bin) - df.pref_depart_time_chauf1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child1_chauf2,Availability for Pure-Escorting by synchronization - Child 1 and Chauffeur 2,@(df.bundle1 > 0) & (df.chauf1 == 4) & (df.ptype_chauf2 < 4) & (df.cdap_chauf2 == 'H') & (np.abs(df.pref_depart_time_school1 + ((df.time_home_to_school1 + df.time_school_to_home1) / mins_per_time_bin) - df.pref_depart_time_chauf2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child2_chauf1,Availability for Pure-Escorting by synchronization - Child 2 and Chauffeur 1,@(df.bundle2 > 0) & (df.chauf2 == 2) & (df.ptype_chauf1 < 4) & (df.cdap_chauf1 == 'H') & (np.abs(df.pref_depart_time_school2 + ((df.time_home_to_school2 + df.time_school_to_home2) / mins_per_time_bin) - df.pref_depart_time_chauf1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child2_chauf2,Availability for Pure-Escorting by synchronization - Child 2 and Chauffeur 2,@(df.bundle2 > 0) & (df.chauf2 == 4) & (df.ptype_chauf2 < 4) & (df.cdap_chauf2 == 'H') & (np.abs(df.pref_depart_time_school2 + ((df.time_home_to_school2 + df.time_school_to_home2) / mins_per_time_bin) - df.pref_depart_time_chauf2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child3_chauf1,Availability for Pure-Escorting by synchronization - Child 3 and Chauffeur 1,@(df.bundle3 > 0) & (df.chauf3 == 2) & (df.ptype_chauf1 < 4) & (df.cdap_chauf1 == 'H') & (np.abs(df.pref_depart_time_school3 + ((df.time_home_to_school3 + df.time_school_to_home3) / mins_per_time_bin) - df.pref_depart_time_chauf1) > max_bin_difference_between_departure_times),coef_unavail +util_avail_pe_sync_child3_chauf2,Availability for Pure-Escorting by synchronization - Child 3 and Chauffeur 2,@(df.bundle3 > 0) & (df.chauf3 == 4) & (df.ptype_chauf2 < 4) & (df.cdap_chauf2 == 'H') & (np.abs(df.pref_depart_time_school3 + ((df.time_home_to_school3 + df.time_school_to_home3) / mins_per_time_bin) - df.pref_depart_time_chauf2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_bundle_child_1and2,Availability for bundling child 1 and child 2,@(df.bundle1 == df.bundle2) & (df.bundle1 > 0) & (np.abs(df.pref_depart_time_school1 - df.pref_depart_time_school2) > max_bin_difference_between_departure_times),coef_unavail +util_avail_bundle_child_1and3,Availability for bundling child 1 and child 3,@(df.bundle1 == df.bundle3) & (df.bundle1 > 0) & (np.abs(df.pref_depart_time_school1 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_bundle_child_2and3,Availability for bundling child 2 and child 3,@(df.bundle2 == df.bundle3) & (df.bundle2 > 0) & (np.abs(df.pref_depart_time_school2 - df.pref_depart_time_school3) > max_bin_difference_between_departure_times),coef_unavail +util_avail_mult_bundles_outbound1,Availability Chauffeur 1 - Expected arrival from previous pure escort must be before departure for subsequent escort,((nrs1 + npe1) > 1) & ~avail_multiple_bundles,coef_unavail +util_avail_mult_bundles_outbound2,Availability Chauffeur 2 - Expected arrival from previous pure escort must be before departure for subsequent escort,((nrs2 + npe2) > 1) & ~avail_multiple_bundles,coef_unavail +util_avail_pe_during_mand_child1_chauf1,Availability pure escort tour must take place before mandatory tour - Child 1 and Chauffeur 1,@(df.bundle1 > 0) & (df.chauf1 == 2) & (df.cdap_chauf1 == 'M') & ((df.pref_depart_time_chauf1 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school1),coef_unavail +util_avail_pe_during_mand_child1_chauf2,Availability pure escort tour must take place before mandatory tour - Child 1 and Chauffeur 2,@(df.bundle1 > 0) & (df.chauf1 == 4) & (df.cdap_chauf2 == 'M') & ((df.pref_depart_time_chauf2 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school1),coef_unavail +util_avail_pe_during_mand_child2_chauf1,Availability pure escort tour must take place before mandatory tour - Child 2 and Chauffeur 1,@(df.bundle2 > 0) & (df.chauf2 == 2) & (df.cdap_chauf1 == 'M') & ((df.pref_depart_time_chauf1 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school2),coef_unavail +util_avail_pe_during_mand_child2_chauf2,Availability pure escort tour must take place before mandatory tour - Child 2 and Chauffeur 2,@(df.bundle2 > 0) & (df.chauf2 == 4) & (df.cdap_chauf2 == 'M') & ((df.pref_depart_time_chauf2 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school2),coef_unavail +util_avail_pe_during_mand_child3_chauf1,Availability pure escort tour must take place before mandatory tour - Child 3 and Chauffeur 1,@(df.bundle3 > 0) & (df.chauf3 == 2) & (df.cdap_chauf1 == 'M') & ((df.pref_depart_time_chauf1 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school3),coef_unavail +util_avail_pe_during_mand_child3_chauf2,Availability pure escort tour must take place before mandatory tour - Child 3 and Chauffeur 2,@(df.bundle3 > 0) & (df.chauf3 == 4) & (df.cdap_chauf2 == 'M') & ((df.pref_depart_time_chauf2 - max_bin_difference_between_departure_times) <= df.pref_depart_time_school3),coef_unavail +# ,No escorting,, +util_child1_age_16p_noes,Child 1 age 16 years or older - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 > 15),coef_child_age_16p_noes +util_child2_age_16p_noes,Child 2 age 16 years or older - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 > 15),coef_child_age_16p_noes +util_child3_age_16p_noes,Child 3 age 16 years or older - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 > 15),coef_child_age_16p_noes +util_child1_age_10_to_15_noes,Child 1 age 10 to 15 years - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 > 9) & (age_child1 < 16),coef_child_age_10_to_15_noes +util_child2_age_10_to_15_noes,Child 2 age 10 to 15 years - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 > 9) & (age_child2 < 16),coef_child_age_10_to_15_noes +util_child3_age_10_to_15_noes,Child 3 age 10 to 15 years - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 > 9) & (age_child3 < 16),coef_child_age_10_to_15_noes +util_child1_age_u9_noes,Child 1 age 9 years or younger - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 < 10),coef_child_age_u9_noes +util_child2_age_u9_noes,Child 2 age 9 years or younger - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 < 10),coef_child_age_u9_noes +util_child3_age_u9_noes,Child 3 age 9 years or younger - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 < 10),coef_child_age_u9_noes +util_ln_dist_to_school_child1_noes,Logged distance to school for Child 1 - No escort,@(df.bundle1 == 0) * (df.child_id1 > 0) * np.log(1 + df.dist_home_to_school1),coef_ln_dist_to_school_noes +util_ln_dist_to_school_child2_noes,Logged distance to school for Child 2 - No escort,@(df.bundle2 == 0) * (df.child_id2 > 0) * np.log(1 + df.dist_home_to_school2),coef_ln_dist_to_school_noes +util_ln_dist_to_school_child3_noes,Logged distance to school for Child 3 - No escort,@(df.bundle3 == 0) * (df.child_id3 > 0) * np.log(1 + df.dist_home_to_school3),coef_ln_dist_to_school_noes +util_ln_dist_to_school_child1_u6_noes,Logged distance to school for Child 1 under 6 years old - No escort,@(df.bundle1 == 0) * (df.child_id1 > 0) * (df.age_child1 < 6) * np.log(1 + df.dist_home_to_school1),coef_ln_dist_to_school_u6_noes +util_ln_dist_to_school_child2_u6_noes,Logged distance to school for Child 2 under 6 years old - No escort,@(df.bundle2 == 0) * (df.child_id2 > 0) * (df.age_child2 < 6) * np.log(1 + df.dist_home_to_school2),coef_ln_dist_to_school_u6_noes +util_ln_dist_to_school_child3_u6_noes,Logged distance to school for Child 3 under 6 years old - No escort,@(df.bundle3 == 0) * (df.child_id3 > 0) * (df.age_child3 < 6) * np.log(1 + df.dist_home_to_school3),coef_ln_dist_to_school_u6_noes +util_ln_dist_to_school_child1_6to9_noes,Logged distance to school for Child 1 6 to 9 years old - No escort,@(df.bundle1 == 0) * (df.child_id1 > 0) * (df.age_child1 > 5) * (df.age_child1 < 10) * np.log(1 + df.dist_home_to_school1),coef_ln_dist_to_school_6to9_noes +util_ln_dist_to_school_child2_6to9_noes,Logged distance to school for Child 2 6 to 9 years old - No escort,@(df.bundle2 == 0) * (df.child_id2 > 0) * (df.age_child2 > 5) * (df.age_child2 < 10) * np.log(1 + df.dist_home_to_school2),coef_ln_dist_to_school_6to9_noes +util_ln_dist_to_school_child3_6to9_noes,Logged distance to school for Child 3 6 to 9 years old - No escort,@(df.bundle3 == 0) * (df.child_id3 > 0) * (df.age_child3 > 5) * (df.age_child3 < 10) * np.log(1 + df.dist_home_to_school3),coef_ln_dist_to_school_6to9_noes +# ,Ride Sharing,, +util_child1_age_16p_rs,Child 1 age 16 years or older - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 15),coef_child_age_16p_rs +util_child2_age_16p_rs,Child 2 age 16 years or older - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 15),coef_child_age_16p_rs +util_child3_age_16p_rs,Child 3 age 16 years or older - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 15),coef_child_age_16p_rs +util_child1_age_10to15_rs,Child 1 age 10 to 15 years - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 9) & (age_child1 < 16),coef_child_age_10to15_rs +util_child2_age_10to15_rs,Child 2 age 10 to 15 years - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 9) & (age_child2 < 16),coef_child_age_10to15_rs +util_child3_age_10to15_rs,Child 3 age 10 to 15 years - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 9) & (age_child3 < 16),coef_child_age_10to15_rs +util_child1_age_6to9_rs,Child 1 age 6 to 9 years - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 5) & (age_child1 < 10),coef_child_age_6to9_rs +util_child2_age_6to9_rs,Child 2 age 6 to 9 years - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 5) & (age_child2 < 10),coef_child_age_6to9_rs +util_child3_age_6to9_rs,Child 3 age 6 to 9 years - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 5) & (age_child3 < 10),coef_child_age_6to9_rs +util_child1_age_u6_rs,Child 1 age under 6 years old - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 < 6),coef_child_age_u6_rs +util_child2_age_u6_rs,Child 2 age under 6 years old - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 < 6),coef_child_age_u6_rs +util_child3_age_u6_rs,Child 3 age under 6 years old - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 < 6),coef_child_age_u6_rs +# ,Pure Escort Distance,, +util_child1_dist_pe,Child 1 distance to school - Pure escorting,((chauf1 == 2) | (chauf1 == 4)) * dist_home_to_school1,coef_child_dist_pe +util_child2_dist_pe,Child 2 distance to school - Pure escorting,((chauf2 == 2) | (chauf2 == 4)) * dist_home_to_school2,coef_child_dist_pe +util_child3_dist_pe,Child 3 distance to school - Pure escorting,((chauf3 == 2) | (chauf3 == 4)) * dist_home_to_school3,coef_child_dist_pe +util_child1_dist_pe,Child 1 Pure escorting not allowed if over 30 miles,((chauf1 == 2) | (chauf1 == 4)) & (dist_home_to_school1 > 30),coef_unavail +util_child2_dist_pe,Child 2 Pure escorting not allowed if over 30 miles,((chauf2 == 2) | (chauf2 == 4)) & (dist_home_to_school2 > 30),coef_unavail +util_child3_dist_pe,Child 3 Pure escorting not allowed if over 30 miles,((chauf3 == 2) | (chauf3 == 4)) & (dist_home_to_school3 > 30),coef_unavail +# ,Household Interactions,, +util_hh_inc_u25k_noes,Household income less than 25k - No Escorting,(income <= 25000) & ((bundle1 == 0) | ((bundle2 == 0) & (num_children_going_to_school > 1)) | ((bundle3 == 0) & (num_children_going_to_school > 2))),coef_hh_inc_u25k_noes +util_hh_inc_25to50k_noes,Household income between 25 and 50k - No Escorting,((income > 25000) & (income <= 50000)) & ((bundle1 == 0) | ((bundle2 == 0) & (num_children_going_to_school > 1)) | ((bundle3 == 0) & (num_children_going_to_school > 2))),coef_hh_inc_25to50k_noes +util_zero_auto_hh_noes,Zero cars in the household - No Escorting,(auto_ownership == 0) & ((bundle1 == 0) | ((bundle2 == 0) & (num_children_going_to_school > 1)) | ((bundle3 == 0) & (num_children_going_to_school > 2))),coef_zero_auto_hh_noes +util_cars_lt_workers_rs,Cars fewer than household workers - Ride Share,(auto_ownership < num_workers) & ((chauf1 % 2 == 1) | (chauf2 % 2 == 1) | (chauf3 % 2 == 1)),coef_cars_lt_workers_rs +util_cars_lt_workers_pe,Cars fewer than household workers - Pure escort,(auto_ownership < num_workers) & ((chauf1 % 2 == 0) | (chauf2 % 2 == 0) | (chauf3 % 2 == 0)),coef_cars_lt_workers_pe +# ,Chauffer Interactions,, +util_chauf1_female_rs,Chauffeur 1 Female - Ride share,(gender_chauf1 == 2) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_female_rs +util_chauf1_male_rs,Chauffeur 1 Male - Ride share,(gender_chauf1 == 1) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_male_rs +util_chauf1_female_pe,Chauffeur 1 Female - Pure Escort,(gender_chauf1 == 2) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_female_pe +util_chauf1_male_pe,Chauffeur 1 Male - Pure Escort,(gender_chauf1 == 1) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_male_pe +util_chauf2_female_rs,Chauffeur 2 Female - Ride share,(gender_chauf2 == 2) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_female_rs +util_chauf2_male_rs,Chauffeur 2 Male - Ride share,(gender_chauf2 == 1) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_male_rs +util_chauf2_female_pe,Chauffeur 2 Female - Pure Escort,(gender_chauf2 == 2) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_female_pe +util_chauf2_male_pe,Chauffeur 2 Male - Pure Escort,(gender_chauf2 == 1) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_male_pe +util_chauf1_pt_worker_rs,Chauffer 1 part time worker - Ride share,(ptype_chauf1 == 2) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_pt_worker_rs +util_chauf1_pt_worker_pe,Chauffer 1 part time worker - Pure escort,(ptype_chauf1 == 2) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_pt_worker_pe +util_chauf2_pt_worker_rs,Chauffer 2 part time worker - Ride share,(ptype_chauf2 == 2) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_pt_worker_rs +util_chauf2_pt_worker_pe,Chauffer 2 part time worker - Pure escort,(ptype_chauf2 == 2) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_pt_worker_pe +util_chauf1_non_worker_pe,Chauffer 1 non worker - Pure escort,(ptype_chauf1 == 4) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_non_worker_pe +util_chauf2_non_worker_pe,Chauffer 2 non worker - Pure escort,(ptype_chauf2 == 4) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_non_worker_pe +util_chauf1_univ_stud_re,Chauffer 1 university student - Ride Share,(ptype_chauf1 == 3) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_univ_stud_re +util_chauf2_univ_stud_re,Chauffer 2 university student - Ride Share,(ptype_chauf2 == 3) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_univ_stud_re +util_chauf1_age_u35_pe,Chauffer 1 Age 35 years or younger - Pure escort,(ptype_chauf1 == 4) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_age_u35_pe +util_chauf2_age_u35_pe,Chauffer 2 Age 35 years or younger - Pure escort,(ptype_chauf2 == 4) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_age_u35_pe +util_chauf1_time_to_work_or_univ_rs,Chauffer 1 Auto time to work or university - Ride Share,time_home_to_mand1 * ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_time_to_work_or_univ_rs +util_chauf2_time_to_work_or_univ_rs,Chauffer 2 Auto time to work or university - Ride Share,time_home_to_mand2 * ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_time_to_work_or_univ_rs +util_chauf1_walk_dist_to_work_or_univ_rs,Chauffer 1 Walk dist to work or university - Ride Share,(dist_home_to_mand1 < 3) & ((chauf1 == 1) | (chauf2 == 1) | (chauf3 == 1)),coef_chauf_walk_dist_to_work_or_univ_rs +util_chauf2_walk_dist_to_work_or_univ_rs,Chauffer 2 Walk dist to work or university - Ride Share,(dist_home_to_mand2 < 3) & ((chauf1 == 3) | (chauf2 == 3) | (chauf3 == 3)),coef_chauf_walk_dist_to_work_or_univ_rs +util_chauf1_walk_dist_to_work_or_univ_pe,Chauffer 1 Walk dist to work or university - Pure Escort,(dist_home_to_mand1 < 3) & ((chauf1 == 2) | (chauf2 == 2) | (chauf3 == 2)),coef_chauf_walk_dist_to_work_or_univ_pe +util_chauf2_walk_dist_to_work_or_univ_pe,Chauffer 2 Walk dist to work or university - Pure Escort,(dist_home_to_mand2 < 3) & ((chauf1 == 4) | (chauf2 == 4) | (chauf3 == 4)),coef_chauf_walk_dist_to_work_or_univ_pe +# ,Chauffer deviation,, +util_chauf1_abs_dev_rs_child1only,Chauffer 1 Absolute deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child1_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child1only,Chauffer 2 Absolute deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child1_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child2only,Chauffer 1 Absolute deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 1)) * abs_dev_dist_out_child2_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child2only,Chauffer 2 Absolute deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 3)) * abs_dev_dist_out_child2_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child3only,Chauffer 1 Absolute deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 1)) * abs_dev_dist_out_child3_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child3only,Chauffer 2 Absolute deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 3)) * abs_dev_dist_out_child3_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child12,Chauffer 1 Absolute deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child12_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child12,Chauffer 2 Absolute deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child12_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child13,Chauffer 1 Absolute deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child13_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child13,Chauffer 2 Absolute deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child13_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child23,Chauffer 1 Absolute deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 1)) * abs_dev_dist_out_child23_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child23,Chauffer 2 Absolute deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 3)) * abs_dev_dist_out_child23_chauf2,coef_abs_dev_distance +util_chauf1_abs_dev_rs_child123,Chauffer 1 Absolute deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child123_chauf1,coef_abs_dev_distance +util_chauf2_abs_dev_rs_child123,Chauffer 2 Absolute deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child123_chauf2,coef_abs_dev_distance +util_chauf1_rel_dev_rs_child1only,Chauffer 1 Relative deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child1_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child1only,Chauffer 2 Relative deviation ride share - child 1 only,((bundle1 != bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child1_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child2only,Chauffer 1 Relative deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 1)) * abs_dev_dist_out_child2_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child2only,Chauffer 2 Relative deviation ride share - child 2 only,((bundle1 != bundle2) & (bundle2 != bundle3) & (chauf2 == 3)) * abs_dev_dist_out_child2_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child3only,Chauffer 1 Relative deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 1)) * abs_dev_dist_out_child3_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child3only,Chauffer 2 Relative deviation ride share - child 3 only,((bundle1 != bundle3) & (bundle2 != bundle3) & (chauf3 == 3)) * abs_dev_dist_out_child3_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child12,Chauffer 1 Relative deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child12_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child12,Chauffer 2 Relative deviation ride share - child 1 & 2,((bundle1 == bundle2) & (bundle1 != bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child12_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child13,Chauffer 1 Relative deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child13_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child13,Chauffer 2 Relative deviation ride share - child 1 & 3,((bundle1 != bundle2) & (bundle1 == bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child13_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child23,Chauffer 1 Relative deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 1)) * abs_dev_dist_out_child23_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child23,Chauffer 2 Relative deviation ride share - child 2 & 3,((bundle1 != bundle2) & (bundle2 == bundle3) & (chauf2 == 3)) * abs_dev_dist_out_child23_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +util_chauf1_rel_dev_rs_child123,Chauffer 1 Relative deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 1)) * abs_dev_dist_out_child123_chauf1 / (dist_home_to_mand1 + 0.001),coef_rel_dev_distance +util_chauf2_rel_dev_rs_child123,Chauffer 2 Relative deviation ride share - child 1 & 2 & 3,((bundle1 == bundle2) & (bundle2 == bundle3) & (chauf1 == 3)) * abs_dev_dist_out_child123_chauf2 / (dist_home_to_mand2 + 0.001),coef_rel_dev_distance +# ,Same TAZ,, +util_same_taz_child12_escort,Same school TAZ for child 1 and 2 - Escorting,(bundle1 == bundle2) & (bundle1 > 0) & (school_location_child1 == school_location_child2) & (school_location_child1 > 0),coef_same_taz_escort +util_same_taz_child13_escort,Same school TAZ for child 1 and 3 - Escorting,(bundle1 == bundle3) & (bundle1 > 0) & (school_location_child1 == school_location_child3) & (school_location_child1 > 0),coef_same_taz_escort +util_same_taz_child32_escort,Same school TAZ for child 3 and 2 - Escorting,(bundle3 == bundle2) & (bundle2 > 0) & (school_location_child3 == school_location_child2) & (school_location_child2 > 0),coef_same_taz_escort +util_same_taz_child12_no_escort,Same school TAZ for child 1 and 2 - No Escorting,(bundle1 == 0) & (bundle2 == 0) & (child_id1 > 0) & (child_id2 > 0) & (school_location_child1 == school_location_child2) & (school_location_child1 > 0),coef_same_taz_no_escort +util_same_taz_child13_no_escort,Same school TAZ for child 1 and 3 - No Escorting,(bundle1 == 0) & (bundle3 == 0) & (child_id1 > 0) & (child_id3 > 0) & (school_location_child1 == school_location_child3) & (school_location_child1 > 0),coef_same_taz_no_escort +util_same_taz_child32_no_escort,Same school TAZ for child 3 and 2 - No Escorting,(bundle3 == 0) & (bundle2 == 0) & (child_id3 > 0) & (child_id2 > 0) & (school_location_child3 == school_location_child2) & (school_location_child2 > 0),coef_same_taz_no_escort +# ,Constants related to inbound choice,, +util_no_escort_inbound_child1,No escorting in inbound direction - Child 1,(bundle1 == 0) & (child_id1 > 0) & (bundle1_inbound == 0),coef_no_escort_inbound +util_no_escort_inbound_child2,No escorting in inbound direction - Child 2,(bundle2 == 0) & (child_id2 > 0) & (bundle2_inbound == 0),coef_no_escort_inbound +util_no_escort_inbound_child3,No escorting in inbound direction - Child 3,(bundle3 == 0) & (child_id3 > 0) & (bundle3_inbound == 0),coef_no_escort_inbound +util_same_chauf,Same chauffeur in both directions (not child specific) - chauf 1 inbound & inbound,((chauf1 == 1) | (chauf1 == 2) | (chauf2 == 1) | (chauf2 == 2) | (chauf3 == 1) | (chauf3 == 2)) & ((nbund1_inbound > 0)),coef_same_chauf +util_same_chauf,Same chauffeur in both directions (not child specific) - chauf 2 inbound & inbound,((chauf1 == 3) | (chauf1 == 4) | (chauf2 == 3) | (chauf2 == 4) | (chauf3 == 3) | (chauf3 == 4)) & ((nbund2_inbound > 0)),coef_same_chauf +# ,Calibration constants,, +util_calib_child1_age_u6_rs,Child 1 age under 6 - Calibration constant - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 < 6),coef_calib_child_age_u6_rs +util_calib_child2_age_u6_rs,Child 2 age under 6 - Calibration constant - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 < 6),coef_calib_child_age_u6_rs +util_calib_child3_age_u6_rs,Child 3 age under 6 - Calibration constant - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 < 6),coef_calib_child_age_u6_rs +util_calib_child1_age_16p_rs,Child 1 age 16 years or older - Calibration constant - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 15),coef_calib_child_age_16p_rs +util_calib_child2_age_16p_rs,Child 2 age 16 years or older - Calibration constant - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 15),coef_calib_child_age_16p_rs +util_calib_child3_age_16p_rs,Child 3 age 16 years or older - Calibration constant - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 15),coef_calib_child_age_16p_rs +util_calib_child1_age_6to15_noes,Child 1 age 6 to 15 years - Calibration constant - No Escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 > 5) & (age_child1 < 16),coef_calib_child_age_6to15_noes +util_calib_child2_age_6to15_noes,Child 2 age 6 to 15 years - Calibration constant - No Escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 > 5) & (age_child2 < 16),coef_calib_child_age_6to15_noes +util_calib_child3_age_6to15_noes,Child 3 age 6 to 15 years - Calibration constant - No Escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 > 5) & (age_child3 < 16),coef_calib_child_age_6to15_noes +util_calib_child1_age_6to15_rs,Child 1 age 6 to 15 years - Calibration constant - Ride Share,((chauf1 == 1) | (chauf1 == 3)) & (age_child1 > 5) & (age_child1 < 16),coef_calib_child_age_6to15_rs +util_calib_child2_age_6to15_rs,Child 2 age 6 to 15 years - Calibration constant - Ride Share,((chauf2 == 1) | (chauf2 == 3)) & (age_child2 > 5) & (age_child2 < 16),coef_calib_child_age_6to15_rs +util_calib_child3_age_6to15_rs,Child 3 age 6 to 15 years - Calibration constant - Ride Share,((chauf3 == 1) | (chauf3 == 3)) & (age_child3 > 5) & (age_child3 < 16),coef_calib_child_age_6to15_rs +util_calib_child1_age_u6_noes,Child 1 age 6 years or younger - Calibration constant - No escort,(bundle1 == 0) & (child_id1 > 0) & (age_child1 < 6),coef_calib_child_age_u6_noes +util_calib_child2_age_u6_noes,Child 2 age 6 years or younger - Calibration constant - No escort,(bundle2 == 0) & (child_id2 > 0) & (age_child2 < 6),coef_calib_child_age_u6_noes +util_calib_child3_age_u6_noes,Child 3 age 6 years or younger - Calibration constant - No escort,(bundle3 == 0) & (child_id3 > 0) & (age_child3 < 6),coef_calib_child_age_u6_noes diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_preprocessor_inbound.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_preprocessor_inbound.csv new file mode 100644 index 0000000000..5efc87882b --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_preprocessor_inbound.csv @@ -0,0 +1,148 @@ +Description,Target,Expression +Number of children going to school,num_children_going_to_school,"np.where(df['child_id1'] > 0, 1, 0) + np.where(df['child_id2'] > 0, 1, 0) + np.where(df['child_id3'] > 0,1,0)" +Number of potential chauffeurs,num_potential_chauffeurs,"np.where(df['chauf_id1'] > 0, 1, 0) + np.where(df['chauf_id2'] > 0, 1, 0)" +Person Type - chauffer 1,ptype_chauf1,"reindex(persons.ptype, df.chauf_id1)" +Person Type - chauffer 2,ptype_chauf2,"reindex(persons.ptype, df.chauf_id2)" +Gender - chauffer 1,gender_chauf1,"reindex(persons.sex, df.chauf_id1)" +Gender - chauffer 2,gender_chauf2,"reindex(persons.sex, df.chauf_id2)" +Age - chauffer 1,age_chauf1,"reindex(persons.age, df.chauf_id1)" +Age - chauffer 2,age_chauf2,"reindex(persons.age, df.chauf_id2)" +Daily activity pattern - chauffer 1,cdap_chauf1,"reindex(persons.cdap_activity, df.chauf_id1)" +Daily activity pattern - chauffer 2,cdap_chauf2,"reindex(persons.cdap_activity, df.chauf_id2)" +Age - child 1,age_child1,"reindex(persons.age, df.child_id1)" +Age - child 2,age_child2,"reindex(persons.age, df.child_id2)" +Age - child 3,age_child3,"reindex(persons.age, df.child_id3)" +# Departure times from school and work ,, +Preferred departure time from school - child 1,pref_depart_time_school1,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').end, df.child_id1)" +Preferred departure time from school - child 2,pref_depart_time_school2,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').end, df.child_id2)" +Preferred departure time from school - child 3,pref_depart_time_school3,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').end, df.child_id3)" +# setting preffered departure time for chauffer to the last mandatory tour of the day for inbound escorting ,, +Preferred departure time from work / univ - chauffer 1 - tour 1,pref_depart_time_chauf1_tour1,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').end, df.chauf_id1)" +Preferred departure time from work / univ - chauffer 2 - tour 1,pref_depart_time_chauf2_tour1,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').end, df.chauf_id2)" +Preferred departure time from work / univ - chauffer 1 - tour 2,pref_depart_time_chauf1_tour2,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 2)].set_index('person_id').end, df.chauf_id1)" +Preferred departure time from work / univ - chauffer 2 - tour 2,pref_depart_time_chauf2_tour2,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 2)].set_index('person_id').end, df.chauf_id2)" +Preferred departure time from work / univ - chauffer 1,pref_depart_time_chauf1,"np.where(pref_depart_time_chauf1_tour2 > pref_depart_time_chauf1_tour1, pref_depart_time_chauf1_tour2, pref_depart_time_chauf1_tour1)" +Preferred departure time from work / univ - chauffer 1,pref_depart_time_chauf2,"np.where(pref_depart_time_chauf2_tour2 > pref_depart_time_chauf2_tour1, pref_depart_time_chauf2_tour2, pref_depart_time_chauf2_tour1)" +# Distances and times to school and work ,, +School location - child 1,school_location_child1,"reindex(persons.school_zone_id, df.child_id1)" +School location - child 2,school_location_child2,"reindex(persons.school_zone_id, df.child_id2)" +School location - child 3,school_location_child3,"reindex(persons.school_zone_id, df.child_id3)" +School location - chauffer 1,_school_location_chauf1,"reindex(persons.workplace_zone_id, df.chauf_id1)" +School location - chauffer 2,_school_location_chauf2,"reindex(persons.workplace_zone_id, df.chauf_id2)" +Work location - chauffer 1,_work_location_chauf1,"reindex(persons.workplace_zone_id, df.chauf_id1)" +Work location - chauffer 2,_work_location_chauf2,"reindex(persons.workplace_zone_id, df.chauf_id2)" +Mandatory tour location - chauffer 1,_mandatory_location_chauf1,"_school_location_chauf1.where(ptype_chauf1 == 3, _work_location_chauf1)" +Mandatory tour location - chauffer 2,_mandatory_location_chauf2,"_school_location_chauf1.where(ptype_chauf2 == 3, _work_location_chauf2)" +# creating valid school locations to pass to skim_dict,, +,_valid_school_location_child1,school_location_child1.fillna(persons[persons.school_zone_id > 0].school_zone_id.mode()[0]) +,_valid_school_location_child2,school_location_child2.fillna(persons[persons.school_zone_id > 0].school_zone_id.mode()[0]) +,_valid_school_location_child3,school_location_child3.fillna(persons[persons.school_zone_id > 0].school_zone_id.mode()[0]) +,_valid_mandatory_location_chauf1,_mandatory_location_chauf1.fillna(persons[persons.workplace_zone_id > 0].workplace_zone_id.mode()[0]) +,_valid_mandatory_location_chauf2,_mandatory_location_chauf2.fillna(persons[persons.workplace_zone_id > 0].workplace_zone_id.mode()[0]) +Auto time home to school - child 1,time_home_to_school1,"np.where(school_location_child1 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child1, ('SOV_TIME', 'PM')), 0)" +Auto time home to school - child 2,time_home_to_school2,"np.where(school_location_child2 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child2, ('SOV_TIME', 'PM')), 0)" +Auto time home to school - child 3,time_home_to_school3,"np.where(school_location_child3 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child3, ('SOV_TIME', 'PM')), 0)" +Auto time school to home - child 1,time_school_to_home1,"np.where(school_location_child1 > 0, skim_dict.lookup(_valid_school_location_child1, df.home_zone_id, ('SOV_TIME', 'PM')), 0)" +Auto time school to home - child 2,time_school_to_home2,"np.where(school_location_child2 > 0, skim_dict.lookup(_valid_school_location_child2, df.home_zone_id, ('SOV_TIME', 'PM')), 0)" +Auto time school to home - child 3,time_school_to_home3,"np.where(school_location_child3 > 0, skim_dict.lookup(_valid_school_location_child3, df.home_zone_id, ('SOV_TIME', 'PM')), 0)" +Auto dist home to school - child 1,dist_school_to_home1,"np.where(school_location_child1 > 0, skim_dict.lookup(_valid_school_location_child1, df.home_zone_id, ('SOV_DIST', 'PM')), 0)" +Auto dist home to school - child 2,dist_school_to_home2,"np.where(school_location_child2 > 0, skim_dict.lookup(_valid_school_location_child2, df.home_zone_id, ('SOV_DIST', 'PM')), 0)" +Auto dist home to school - child 3,dist_school_to_home3,"np.where(school_location_child3 > 0, skim_dict.lookup(_valid_school_location_child3, df.home_zone_id, ('SOV_DIST', 'PM')), 0)" +Auto dist intra school taz - child 1,dist_intra_school1,"np.where(school_location_child1 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child1, ('SOV_DIST', 'PM')), 0)" +Auto dist intra school taz - child 2,dist_intra_school2,"np.where(school_location_child2 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child2, ('SOV_DIST', 'PM')), 0)" +Auto dist intra school taz - child 3,dist_intra_school3,"np.where(school_location_child3 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child3, ('SOV_DIST', 'PM')), 0)" +Auto time home to work or university - chauffer 1,time_home_to_mand1,"np.where(_mandatory_location_chauf1 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf1, ('SOV_TIME', 'PM')), 0)" +Auto time home to work or university - chauffer 2,time_home_to_mand2,"np.where(_mandatory_location_chauf2 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf2, ('SOV_TIME', 'PM')), 0)" +Auto time work or university to home - chauffer 1,time_mand_to_home1,"np.where(_mandatory_location_chauf1 > 0, skim_dict.lookup(_valid_mandatory_location_chauf1, df.home_zone_id, ('SOV_TIME', 'PM')), 0)" +Auto time work or university to home - chauffer 2,time_mand_to_home2,"np.where(_mandatory_location_chauf2 > 0, skim_dict.lookup(_valid_mandatory_location_chauf2, df.home_zone_id, ('SOV_TIME', 'PM')), 0)" +Auto dist home to work or university - chauffer 1,dist_home_to_mand1,"np.where(_mandatory_location_chauf1 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf1, ('SOV_DIST', 'PM')), 0)" +Auto dist home to work or university - chauffer 2,dist_home_to_mand2,"np.where(_mandatory_location_chauf2 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf2, ('SOV_DIST', 'PM')), 0)" +Auto dist work or university to home - chauffer 1,dist_mand1_to_home,"np.where(_mandatory_location_chauf1 > 0, skim_dict.lookup(_valid_mandatory_location_chauf1, df.home_zone_id, ('SOV_DIST', 'PM')), 0)" +Auto dist work or university to home - chauffer 2,dist_mand2_to_home,"np.where(_mandatory_location_chauf2 > 0, skim_dict.lookup(_valid_mandatory_location_chauf2, df.home_zone_id, ('SOV_DIST', 'PM')), 0)" +# inbound distance combinations between chauffeurs and children,, +Distance from chauffeur 1 mandatory location to child 1 school,time_mand1_to_school1,"np.where((school_location_child1 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_mandatory_location_chauf1, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 1 mandatory location to child 2 school,time_mand1_to_school2,"np.where((school_location_child2 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_mandatory_location_chauf1, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 1 mandatory location to child 3 school,time_mand1_to_school3,"np.where((school_location_child3 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_mandatory_location_chauf1, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 2 mandatory location to child 1 school,time_mand2_to_school1,"np.where((school_location_child1 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_mandatory_location_chauf2, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 2 mandatory location to child 2 school,time_mand2_to_school2,"np.where((school_location_child2 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_mandatory_location_chauf2, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 2 mandatory location to child 3 school,time_mand2_to_school3,"np.where((school_location_child3 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_mandatory_location_chauf2, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 1 mandatory location to child 1 school,_dist_mand1_to_school1,"np.where((school_location_child1 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_mandatory_location_chauf1, _valid_school_location_child1, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 2 mandatory location to child 1 school,_dist_mand2_to_school1,"np.where((school_location_child1 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_mandatory_location_chauf2, _valid_school_location_child1, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 1 mandatory location to child 2 school,_dist_mand1_to_school2,"np.where((school_location_child2 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_mandatory_location_chauf1, _valid_school_location_child2, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 2 mandatory location to child 2 school,_dist_mand2_to_school2,"np.where((school_location_child2 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_mandatory_location_chauf2, _valid_school_location_child2, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 1 mandatory location to child 3 school,_dist_mand1_to_school3,"np.where((school_location_child3 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_mandatory_location_chauf1, _valid_school_location_child3, ('SOV_TIME', 'PM')), 0)" +Distance from chauffeur 2 mandatory location to child 3 school,_dist_mand2_to_school3,"np.where((school_location_child3 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_mandatory_location_chauf2, _valid_school_location_child3, ('SOV_TIME', 'PM')), 0)" +Distance from child 1 school to child 2 school,_dist_school1_to_school2,"np.where((school_location_child1 > 0) & (school_location_child2 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_school_location_child2, ('SOV_TIME', 'PM')), 0)" +Distance from child 1 school to child 3 school,_dist_school1_to_school3,"np.where((school_location_child1 > 0) & (school_location_child3 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_school_location_child3, ('SOV_TIME', 'PM')), 0)" +Distance from child 2 school to child 3 school,_dist_school2_to_school3,"np.where((school_location_child2 > 0) & (school_location_child3 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_school_location_child3, ('SOV_TIME', 'PM')), 0)" +Distance from child 2 school to child 1 school,_dist_school2_to_school1,"np.where((school_location_child2 > 0) & (school_location_child1 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_school_location_child1, ('SOV_TIME', 'PM')), 0)" +Distance from child 3 school to child 1 school,_dist_school3_to_school1,"np.where((school_location_child3 > 0) & (school_location_child1 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_school_location_child1, ('SOV_TIME', 'PM')), 0)" +Distance from child 3 school to child 2 school,_dist_school3_to_school2,"np.where((school_location_child3 > 0) & (school_location_child2 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_school_location_child2, ('SOV_TIME', 'PM')), 0)" +,_return_min_taking_child1,"(pref_depart_time_school1 * mins_per_time_bin) + time_home_to_school1 + time_school_to_home1" +,_return_min_taking_child2,"(pref_depart_time_school2 * mins_per_time_bin) + time_home_to_school2 + time_school_to_home2" +,_return_min_taking_child3,"(pref_depart_time_school3 * mins_per_time_bin) + time_home_to_school3 + time_school_to_home3" +Availability of taking child 1 and then 2,_avail_child1_then_child2,"(_return_min_taking_child1 < (pref_depart_time_school2 * mins_per_time_bin))" +Availability of taking child 2 and then 1,_avail_child2_then_child1,"(_return_min_taking_child2 < (pref_depart_time_school1 * mins_per_time_bin))" +Availability of taking child 1 and then 3,_avail_child1_then_child3,"(_return_min_taking_child1 < (pref_depart_time_school3 * mins_per_time_bin))" +Availability of taking child 3 and then 1,_avail_child3_then_child1,"(_return_min_taking_child3 < (pref_depart_time_school1 * mins_per_time_bin))" +Availability of taking child 2 and then 3,_avail_child2_then_child3,"(_return_min_taking_child2 < (pref_depart_time_school3 * mins_per_time_bin))" +Availability of taking child 3 and then 2,_avail_child3_then_child2,"(_return_min_taking_child3 < (pref_depart_time_school2 * mins_per_time_bin))" +multiple_bundle_availability,avail_multiple_bundles,(_avail_child1_then_child2 | _avail_child2_then_child1 | _avail_child1_then_child3 | _avail_child3_then_child1 | _avail_child2_then_child3 | _avail_child3_then_child2) +# absolute deviation distance inbound,, +Absolute deviation inbound distance Child 1 Chauffer 1,abs_dev_dist_in_child1_chauf1,"np.maximum(_dist_mand1_to_school1 + dist_school_to_home1 - dist_mand1_to_home,0)" +Absolute deviation inbound distance Child 1 Chauffer 2,abs_dev_dist_in_child1_chauf2,"np.maximum(_dist_mand2_to_school1 + dist_school_to_home1 - dist_mand2_to_home,0)" +Absolute deviation inbound distance Child 2 Chauffer 1,abs_dev_dist_in_child2_chauf1,"np.maximum(_dist_mand1_to_school2 + dist_school_to_home2 - dist_mand1_to_home,0)" +Absolute deviation inbound distance Child 2 Chauffer 2,abs_dev_dist_in_child2_chauf2,"np.maximum(_dist_mand2_to_school2 + dist_school_to_home2 - dist_mand2_to_home,0)" +Absolute deviation inbound distance Child 3 Chauffer 1,abs_dev_dist_in_child3_chauf1,"np.maximum(_dist_mand1_to_school3 + dist_school_to_home3 - dist_mand1_to_home,0)" +Absolute deviation inbound distance Child 3 Chauffer 2,abs_dev_dist_in_child3_chauf2,"np.maximum(_dist_mand2_to_school3 + dist_school_to_home3 - dist_mand2_to_home,0)" +Absolute deviation inbound distance child12 Chauffer 1,abs_dev_dist_in_child12_chauf1,"np.maximum(np.minimum(_dist_mand1_to_school1 + _dist_school1_to_school2 + dist_school_to_home2, _dist_mand1_to_school2 + _dist_school2_to_school1 + dist_school_to_home1) - dist_mand1_to_home, 0)" +Absolute deviation inbound distance child12 Chauffer 2,abs_dev_dist_in_child12_chauf2,"np.maximum(np.minimum(_dist_mand2_to_school1 + _dist_school1_to_school2 + dist_school_to_home2, _dist_mand2_to_school2 + _dist_school2_to_school1 + dist_school_to_home1) - dist_mand2_to_home, 0)" +Absolute deviation inbound distance child13 Chauffer 1,abs_dev_dist_in_child13_chauf1,"np.maximum(np.minimum(_dist_mand1_to_school1 + _dist_school1_to_school3 + dist_school_to_home2, _dist_mand1_to_school3 + _dist_school3_to_school1 + dist_school_to_home3) - dist_mand1_to_home, 0)" +Absolute deviation inbound distance child13 Chauffer 2,abs_dev_dist_in_child13_chauf2,"np.maximum(np.minimum(_dist_mand2_to_school1 + _dist_school1_to_school3 + dist_school_to_home2, _dist_mand2_to_school3 + _dist_school3_to_school1 + dist_school_to_home3) - dist_mand2_to_home, 0)" +Absolute deviation inbound distance child23 Chauffer 1,abs_dev_dist_in_child23_chauf1,"np.maximum(np.minimum(_dist_mand1_to_school1 + _dist_school2_to_school3 + dist_school_to_home3, _dist_mand1_to_school3 + _dist_school3_to_school2 + dist_school_to_home2) - dist_mand1_to_home, 0)" +Absolute deviation inbound distance child23 Chauffer 2,abs_dev_dist_in_child23_chauf2,"np.maximum(np.minimum(_dist_mand2_to_school1 + _dist_school2_to_school3 + dist_school_to_home3, _dist_mand2_to_school3 + _dist_school3_to_school2 + dist_school_to_home2) - dist_mand2_to_home, 0)" +,_dist_mand1_school1_school2_school3,"_dist_mand1_to_school1 + _dist_school1_to_school2 + _dist_school2_to_school3 + dist_school_to_home1" +,_dist_mand1_school1_school3_school2,"_dist_mand1_to_school1 + _dist_school1_to_school3 + _dist_school3_to_school2 + dist_school_to_home1" +,_dist_mand1_school2_school1_school3,"_dist_mand1_to_school2 + _dist_school2_to_school1 + _dist_school1_to_school3 + dist_school_to_home2" +,_dist_mand1_school2_school3_school1,"_dist_mand1_to_school2 + _dist_school2_to_school3 + _dist_school3_to_school1 + dist_school_to_home2" +,_dist_mand1_school3_school1_school2,"_dist_mand1_to_school3 + _dist_school3_to_school1 + _dist_school1_to_school2 + dist_school_to_home3" +,_dist_mand1_school3_school2_school1,"_dist_mand1_to_school3 + _dist_school3_to_school2 + _dist_school2_to_school1 + dist_school_to_home3" +,_min_dist_dropoff_order_in_child123_chauf1,_dist_mand1_school1_school2_school3 +,_min_dist_dropoff_order_in_child123_chauf1,"np.where((_dist_mand1_school1_school3_school2 > 0) & (_dist_mand1_school1_school3_school2 < _min_dist_dropoff_order_in_child123_chauf1), _dist_mand1_school1_school3_school2, _min_dist_dropoff_order_in_child123_chauf1)" +,_min_dist_dropoff_order_in_child123_chauf1,"np.where((_dist_mand1_school2_school1_school3 > 0) & (_dist_mand1_school2_school1_school3 < _min_dist_dropoff_order_in_child123_chauf1), _dist_mand1_school2_school1_school3, _min_dist_dropoff_order_in_child123_chauf1)" +,_min_dist_dropoff_order_in_child123_chauf1,"np.where((_dist_mand1_school2_school3_school1 > 0) & (_dist_mand1_school2_school3_school1 < _min_dist_dropoff_order_in_child123_chauf1), _dist_mand1_school2_school3_school1, _min_dist_dropoff_order_in_child123_chauf1)" +,_min_dist_dropoff_order_in_child123_chauf1,"np.where((_dist_mand1_school3_school1_school2 > 0) & (_dist_mand1_school3_school1_school2 < _min_dist_dropoff_order_in_child123_chauf1), _dist_mand1_school3_school1_school2, _min_dist_dropoff_order_in_child123_chauf1)" +,_min_dist_dropoff_order_in_child123_chauf1,"np.where((_dist_mand1_school3_school2_school1 > 0) & (_dist_mand1_school3_school2_school1 < _min_dist_dropoff_order_in_child123_chauf1), _dist_mand1_school3_school2_school1, _min_dist_dropoff_order_in_child123_chauf1)" +Absolute deviation inbound distance child123 Chauffer 1,abs_dev_dist_in_child123_chauf1,"np.maximum(_min_dist_dropoff_order_in_child123_chauf1 - dist_home_to_mand1, 0)" +,_dist_mand2_school1_school2_school3,"_dist_mand2_to_school1 + _dist_school1_to_school2 + _dist_school2_to_school3 + dist_school_to_home1" +,_dist_mand2_school1_school3_school2,"_dist_mand2_to_school1 + _dist_school1_to_school3 + _dist_school3_to_school2 + dist_school_to_home1" +,_dist_mand2_school2_school1_school3,"_dist_mand2_to_school2 + _dist_school2_to_school1 + _dist_school1_to_school3 + dist_school_to_home2" +,_dist_mand2_school2_school3_school1,"_dist_mand2_to_school2 + _dist_school2_to_school3 + _dist_school3_to_school1 + dist_school_to_home2" +,_dist_mand2_school3_school1_school2,"_dist_mand2_to_school3 + _dist_school3_to_school1 + _dist_school1_to_school2 + dist_school_to_home3" +,_dist_mand2_school3_school2_school1,"_dist_mand2_to_school3 + _dist_school3_to_school2 + _dist_school2_to_school1 + dist_school_to_home3" +,_min_dist_dropoff_order_in_child123_chauf2,_dist_mand2_school1_school2_school3 +,_min_dist_dropoff_order_in_child123_chauf2,"np.where((_dist_mand2_school1_school3_school2 > 0) & (_dist_mand2_school1_school3_school2 < _min_dist_dropoff_order_in_child123_chauf2), _dist_mand2_school1_school3_school2, _min_dist_dropoff_order_in_child123_chauf2)" +,_min_dist_dropoff_order_in_child123_chauf2,"np.where((_dist_mand2_school2_school1_school3 > 0) & (_dist_mand2_school2_school1_school3 < _min_dist_dropoff_order_in_child123_chauf2), _dist_mand2_school2_school1_school3, _min_dist_dropoff_order_in_child123_chauf2)" +,_min_dist_dropoff_order_in_child123_chauf2,"np.where((_dist_mand2_school2_school3_school1 > 0) & (_dist_mand2_school2_school3_school1 < _min_dist_dropoff_order_in_child123_chauf2), _dist_mand2_school2_school3_school1, _min_dist_dropoff_order_in_child123_chauf2)" +,_min_dist_dropoff_order_in_child123_chauf2,"np.where((_dist_mand2_school3_school1_school2 > 0) & (_dist_mand2_school3_school1_school2 < _min_dist_dropoff_order_in_child123_chauf2), _dist_mand2_school3_school1_school2, _min_dist_dropoff_order_in_child123_chauf2)" +,_min_dist_dropoff_order_in_child123_chauf2,"np.where((_dist_mand2_school3_school2_school1 > 0) & (_dist_mand2_school3_school2_school1 < _min_dist_dropoff_order_in_child123_chauf2), _dist_mand2_school3_school2_school1, _min_dist_dropoff_order_in_child123_chauf2)" +Absolute deviation inbound distance child123 Chauffer 2,abs_dev_dist_in_child123_chauf2,"np.maximum(_min_dist_dropoff_order_in_child123_chauf2 - dist_home_to_mand1, 0)" +# overlapping time windows from outbound escorting,, +Preferred departure time to school - child 1,_pref_depart_time_to_school1,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').start, df.child_id1)" +Preferred departure time to school - child 2,_pref_depart_time_to_school2,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').start, df.child_id2)" +Preferred departure time to school - child 3,_pref_depart_time_to_school3,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').start, df.child_id3)" +,return_min_taking_outbound_child1_pe,"(_pref_depart_time_to_school1 * mins_per_time_bin) + time_home_to_school1 + time_school_to_home1" +,return_min_taking_outbound_child2_pe,"(_pref_depart_time_to_school2 * mins_per_time_bin) + time_home_to_school2 + time_school_to_home2" +,return_min_taking_outbound_child3_pe,"(_pref_depart_time_to_school3 * mins_per_time_bin) + time_home_to_school3 + time_school_to_home3" +finding latest time chauffer 1 returns from outbound pure escort tour,outbound_pe_return_time_home_chauf1,-1 +,outbound_pe_return_time_home_chauf1,"np.where((df.chauf1_outbound == 2) & (return_min_taking_outbound_child1_pe > outbound_pe_return_time_home_chauf1), return_min_taking_outbound_child1_pe, outbound_pe_return_time_home_chauf1)" +,outbound_pe_return_time_home_chauf1,"np.where((df.chauf2_outbound == 2) & (return_min_taking_outbound_child2_pe > outbound_pe_return_time_home_chauf1), return_min_taking_outbound_child2_pe, outbound_pe_return_time_home_chauf1)" +,outbound_pe_return_time_home_chauf1,"np.where((df.chauf3_outbound == 2) & (return_min_taking_outbound_child3_pe > outbound_pe_return_time_home_chauf1), return_min_taking_outbound_child3_pe, outbound_pe_return_time_home_chauf1)" +finding latest time chauffer 2 returns from outbound pure escort tour,outbound_pe_return_time_home_chauf2,-1 +,outbound_pe_return_time_home_chauf2,"np.where((df.chauf1_outbound == 4) & (return_min_taking_outbound_child1_pe > outbound_pe_return_time_home_chauf2), return_min_taking_outbound_child1_pe, outbound_pe_return_time_home_chauf2)" +,outbound_pe_return_time_home_chauf2,"np.where((df.chauf2_outbound == 4) & (return_min_taking_outbound_child2_pe > outbound_pe_return_time_home_chauf2), return_min_taking_outbound_child2_pe, outbound_pe_return_time_home_chauf2)" +,outbound_pe_return_time_home_chauf2,"np.where((df.chauf3_outbound == 4) & (return_min_taking_outbound_child3_pe > outbound_pe_return_time_home_chauf2), return_min_taking_outbound_child3_pe, outbound_pe_return_time_home_chauf2)" +finding latest time chauffer 1 returns from outbound ride share tour,outbound_rs_return_time_home_chauf1,pref_depart_time_chauf1 +finding latest time chauffer 2 returns from outbound ride share tour,outbound_rs_return_time_home_chauf2,pref_depart_time_chauf2 +return time of outbound school escoring tour - chauffeur 1,return_bin_outbound_school_escorting1,"np.where(df.nrs1_outbound > 0, pref_depart_time_chauf1, outbound_pe_return_time_home_chauf1 / mins_per_time_bin)" +return time of outbound school escoring tour - chauffeur 2,return_bin_outbound_school_escorting2,"np.where(df.nrs2_outbound > 0, pref_depart_time_chauf2, outbound_pe_return_time_home_chauf2 / mins_per_time_bin)" diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_preprocessor_outbound.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_preprocessor_outbound.csv new file mode 100644 index 0000000000..78b7f25785 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_preprocessor_outbound.csv @@ -0,0 +1,122 @@ +Description,Target,Expression +Number of children going to school,num_children_going_to_school,"np.where(df['child_id1'] > 0, 1, 0) + np.where(df['child_id2'] > 0, 1, 0) + np.where(df['child_id3'] > 0,1,0)" +Number of potential chauffeurs,num_potential_chauffeurs,"np.where(df['chauf_id1'] > 0, 1, 0) + np.where(df['chauf_id2'] > 0, 1, 0)" +Person Type - chauffer 1,ptype_chauf1,"reindex(persons.ptype, df.chauf_id1)" +Person Type - chauffer 2,ptype_chauf2,"reindex(persons.ptype, df.chauf_id2)" +Gender - chauffer 1,gender_chauf1,"reindex(persons.sex, df.chauf_id1)" +Gender - chauffer 2,gender_chauf2,"reindex(persons.sex, df.chauf_id2)" +Age - chauffer 1,age_chauf1,"reindex(persons.age, df.chauf_id1)" +Age - chauffer 2,age_chauf2,"reindex(persons.age, df.chauf_id2)" +Daily activity pattern - chauffer 1,cdap_chauf1,"reindex(persons.cdap_activity, df.chauf_id1)" +Daily activity pattern - chauffer 2,cdap_chauf2,"reindex(persons.cdap_activity, df.chauf_id2)" +Age - child 1,age_child1,"reindex(persons.age, df.child_id1)" +Age - child 2,age_child2,"reindex(persons.age, df.child_id2)" +Age - child 3,age_child3,"reindex(persons.age, df.child_id3)" +# Departure times to school and work +Preferred departure time to school - child 1,pref_depart_time_school1,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').start, df.child_id1)" +Preferred departure time to school - child 2,pref_depart_time_school2,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').start, df.child_id2)" +Preferred departure time to school - child 3,pref_depart_time_school3,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').start, df.child_id3)" +Preferred departure time to work / univ - chauffer 1,pref_depart_time_chauf1,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').start, df.chauf_id1)" +Preferred departure time to work / univ - chauffer 2,pref_depart_time_chauf2,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').start, df.chauf_id2)" +# Distances and times to school and work +School location - child 1,school_location_child1,"reindex(persons.school_zone_id, df.child_id1)" +School location - child 2,school_location_child2,"reindex(persons.school_zone_id, df.child_id2)" +School location - child 3,school_location_child3,"reindex(persons.school_zone_id, df.child_id3)" +School location - chauffer 1,_school_location_chauf1,"reindex(persons.workplace_zone_id, df.chauf_id1)" +School location - chauffer 2,_school_location_chauf2,"reindex(persons.workplace_zone_id, df.chauf_id2)" +Work location - chauffer 1,_work_location_chauf1,"reindex(persons.workplace_zone_id, df.chauf_id1)" +Work location - chauffer 2,_work_location_chauf2,"reindex(persons.workplace_zone_id, df.chauf_id2)" +Mandatory tour location - chauffer 1,_mandatory_location_chauf1,"_school_location_chauf1.where(ptype_chauf1 == 3, _work_location_chauf1)" +Mandatory tour location - chauffer 2,_mandatory_location_chauf2,"_school_location_chauf1.where(ptype_chauf2 == 3, _work_location_chauf2)" +# creating valid school locations to pass to skim_dict,, +,_valid_school_location_child1,school_location_child1.fillna(persons[persons.school_zone_id > 0].school_zone_id.mode()[0]) +,_valid_school_location_child2,school_location_child2.fillna(persons[persons.school_zone_id > 0].school_zone_id.mode()[0]) +,_valid_school_location_child3,school_location_child3.fillna(persons[persons.school_zone_id > 0].school_zone_id.mode()[0]) +,_valid_mandatory_location_chauf1,_mandatory_location_chauf1.fillna(persons[persons.workplace_zone_id > 0].workplace_zone_id.mode()[0]) +,_valid_mandatory_location_chauf2,_mandatory_location_chauf2.fillna(persons[persons.workplace_zone_id > 0].workplace_zone_id.mode()[0]) +Auto time home to school - child 1,time_home_to_school1,"np.where(school_location_child1 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child1, ('SOV_TIME', 'AM')), 0)" +Auto time home to school - child 2,time_home_to_school2,"np.where(school_location_child2 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child2, ('SOV_TIME', 'AM')), 0)" +Auto time home to school - child 3,time_home_to_school3,"np.where(school_location_child3 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child3, ('SOV_TIME', 'AM')), 0)" +Auto time school to home - child 1,time_school_to_home1,"np.where(school_location_child1 > 0, skim_dict.lookup(_valid_school_location_child1, df.home_zone_id, ('SOV_TIME', 'AM')), 0)" +Auto time school to home - child 2,time_school_to_home2,"np.where(school_location_child2 > 0, skim_dict.lookup(_valid_school_location_child2, df.home_zone_id, ('SOV_TIME', 'AM')), 0)" +Auto time school to home - child 3,time_school_to_home3,"np.where(school_location_child3 > 0, skim_dict.lookup(_valid_school_location_child3, df.home_zone_id, ('SOV_TIME', 'AM')), 0)" +Auto dist home to school - child 1,dist_home_to_school1,"np.where(school_location_child1 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child1, ('SOV_DIST', 'AM')), 0)" +Auto dist home to school - child 2,dist_home_to_school2,"np.where(school_location_child2 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child2, ('SOV_DIST', 'AM')), 0)" +Auto dist home to school - child 3,dist_home_to_school3,"np.where(school_location_child3 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child3, ('SOV_DIST', 'AM')), 0)" +Auto dist intra school taz - child 1,dist_intra_school1,"np.where(school_location_child1 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child1, ('SOV_DIST', 'AM')), 0)" +Auto dist intra school taz - child 2,dist_intra_school2,"np.where(school_location_child2 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child2, ('SOV_DIST', 'AM')), 0)" +Auto dist intra school taz - child 3,dist_intra_school3,"np.where(school_location_child3 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child3, ('SOV_DIST', 'AM')), 0)" +Auto time home to work or university - chauffer 1,time_home_to_mand1,"np.where(_mandatory_location_chauf1 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf1, ('SOV_TIME', 'AM')), 0)" +Auto time home to work or university - chauffer 2,time_home_to_mand2,"np.where(_mandatory_location_chauf2 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf2, ('SOV_TIME', 'AM')), 0)" +Auto dist home to work or university - chauffer 1,dist_home_to_mand1,"np.where(_mandatory_location_chauf1 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf1, ('SOV_DIST', 'AM')), 0)" +Auto dist home to work or university - chauffer 2,dist_home_to_mand2,"np.where(_mandatory_location_chauf2 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf2, ('SOV_DIST', 'AM')), 0)" +# outbound distance combinations between chauffeurs and children,, +Distance from child 1 school to chauffeur 1 mandatory location,_dist_school1_to_mand1,"np.where((school_location_child1 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_mandatory_location_chauf1, ('SOV_TIME', 'AM')), 0)" +Distance from child 1 school to chauffeur 2 mandatory location,_dist_school1_to_mand2,"np.where((school_location_child1 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_mandatory_location_chauf2, ('SOV_TIME', 'AM')), 0)" +Distance from child 2 school to chauffeur 1 mandatory location,_dist_school2_to_mand1,"np.where((school_location_child2 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_mandatory_location_chauf1, ('SOV_TIME', 'AM')), 0)" +Distance from child 2 school to chauffeur 2 mandatory location,_dist_school2_to_mand2,"np.where((school_location_child2 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_mandatory_location_chauf2, ('SOV_TIME', 'AM')), 0)" +Distance from child 3 school to chauffeur 1 mandatory location,_dist_school3_to_mand1,"np.where((school_location_child3 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_mandatory_location_chauf1, ('SOV_TIME', 'AM')), 0)" +Distance from child 3 school to chauffeur 2 mandatory location,_dist_school3_to_mand2,"np.where((school_location_child3 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_mandatory_location_chauf2, ('SOV_TIME', 'AM')), 0)" +Distance from child 1 school to child 2 school,_dist_school1_to_school2,"np.where((school_location_child1 > 0) & (school_location_child2 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_school_location_child2, ('SOV_TIME', 'AM')), 0)" +Distance from child 1 school to child 3 school,_dist_school1_to_school3,"np.where((school_location_child1 > 0) & (school_location_child3 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_school_location_child3, ('SOV_TIME', 'AM')), 0)" +Distance from child 2 school to child 3 school,_dist_school2_to_school3,"np.where((school_location_child2 > 0) & (school_location_child3 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_school_location_child3, ('SOV_TIME', 'AM')), 0)" +Distance from child 2 school to child 1 school,_dist_school2_to_school1,"np.where((school_location_child2 > 0) & (school_location_child1 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_school_location_child1, ('SOV_TIME', 'AM')), 0)" +Distance from child 3 school to child 1 school,_dist_school3_to_school1,"np.where((school_location_child3 > 0) & (school_location_child1 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_school_location_child1, ('SOV_TIME', 'AM')), 0)" +Distance from child 3 school to child 2 school,_dist_school3_to_school2,"np.where((school_location_child3 > 0) & (school_location_child2 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_school_location_child2, ('SOV_TIME', 'AM')), 0)" +# absolute deviation distance outbound,, +Absolute deviation outbound distance Child 1 Chauffer 1,abs_dev_dist_out_child1_chauf1,"np.maximum(dist_home_to_school1 + _dist_school1_to_mand1 - dist_home_to_mand1,0)" +Absolute deviation outbound distance Child 1 Chauffer 2,abs_dev_dist_out_child1_chauf2,"np.maximum(dist_home_to_school1 + _dist_school1_to_mand2 - dist_home_to_mand2,0)" +Absolute deviation outbound distance Child 2 Chauffer 1,abs_dev_dist_out_child2_chauf1,"np.maximum(dist_home_to_school2 + _dist_school2_to_mand1 - dist_home_to_mand1,0)" +Absolute deviation outbound distance Child 2 Chauffer 2,abs_dev_dist_out_child2_chauf2,"np.maximum(dist_home_to_school2 + _dist_school2_to_mand2 - dist_home_to_mand2,0)" +Absolute deviation outbound distance Child 3 Chauffer 1,abs_dev_dist_out_child3_chauf1,"np.maximum(dist_home_to_school3 + _dist_school3_to_mand1 - dist_home_to_mand1,0)" +Absolute deviation outbound distance Child 3 Chauffer 2,abs_dev_dist_out_child3_chauf2,"np.maximum(dist_home_to_school3 + _dist_school3_to_mand2 - dist_home_to_mand2,0)" +Absolute deviation outbound distance child12 Chauffer 1,abs_dev_dist_out_child12_chauf1,"np.maximum(np.minimum(dist_home_to_school1 + _dist_school1_to_school2 + _dist_school2_to_mand1, dist_home_to_school2 + _dist_school2_to_school1 + _dist_school1_to_mand1) - dist_home_to_mand1, 0)" +Absolute deviation outbound distance child12 Chauffer 2,abs_dev_dist_out_child12_chauf2,"np.maximum(np.minimum(dist_home_to_school1 + _dist_school1_to_school2 + _dist_school2_to_mand2, dist_home_to_school2 + _dist_school2_to_school1 + _dist_school1_to_mand2) - dist_home_to_mand2, 0)" +Absolute deviation outbound distance child13 Chauffer 1,abs_dev_dist_out_child13_chauf1,"np.maximum(np.minimum(dist_home_to_school1 + _dist_school1_to_school3 + _dist_school3_to_mand1, dist_home_to_school3 + _dist_school3_to_school1 + _dist_school1_to_mand1) - dist_home_to_mand1, 0)" +Absolute deviation outbound distance child13 Chauffer 2,abs_dev_dist_out_child13_chauf2,"np.maximum(np.minimum(dist_home_to_school1 + _dist_school1_to_school3 + _dist_school3_to_mand2, dist_home_to_school3 + _dist_school3_to_school1 + _dist_school1_to_mand2) - dist_home_to_mand2, 0)" +Absolute deviation outbound distance child23 Chauffer 1,abs_dev_dist_out_child23_chauf1,"np.maximum(np.minimum(dist_home_to_school2 + _dist_school2_to_school3 + _dist_school3_to_mand1, dist_home_to_school3 + _dist_school3_to_school2 + _dist_school2_to_mand1) - dist_home_to_mand1, 0)" +Absolute deviation outbound distance child23 Chauffer 2,abs_dev_dist_out_child23_chauf2,"np.maximum(np.minimum(dist_home_to_school2 + _dist_school2_to_school3 + _dist_school3_to_mand2, dist_home_to_school3 + _dist_school3_to_school2 + _dist_school2_to_mand2) - dist_home_to_mand2, 0)" +,_dist_school1_school2_school3_mand1,"dist_home_to_school1 + _dist_school1_to_school2 + _dist_school2_to_school3 + _dist_school3_to_mand1" +,_dist_school1_school3_school2_mand1,"dist_home_to_school1 + _dist_school1_to_school3 + _dist_school3_to_school2 + _dist_school2_to_mand1" +,_dist_school2_school1_school3_mand1,"dist_home_to_school2 + _dist_school2_to_school1 + _dist_school1_to_school3 + _dist_school3_to_mand1" +,_dist_school2_school3_school1_mand1,"dist_home_to_school2 + _dist_school2_to_school3 + _dist_school3_to_school1 + _dist_school1_to_mand1" +,_dist_school3_school1_school2_mand1,"dist_home_to_school3 + _dist_school3_to_school1 + _dist_school1_to_school2 + _dist_school2_to_mand1" +,_dist_school3_school2_school1_mand1,"dist_home_to_school3 + _dist_school3_to_school2 + _dist_school2_to_school1 + _dist_school1_to_mand1" +,_min_dist_dropoff_order_out_child123_chauf1,_dist_school1_school2_school3_mand1 +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school1_school3_school2_mand1 > 0) & (_dist_school1_school3_school2_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school1_school3_school2_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school2_school1_school3_mand1 > 0) & (_dist_school2_school1_school3_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school2_school1_school3_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school2_school3_school1_mand1 > 0) & (_dist_school2_school3_school1_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school2_school3_school1_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school3_school1_school2_mand1 > 0) & (_dist_school3_school1_school2_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school3_school1_school2_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school3_school2_school1_mand1 > 0) & (_dist_school3_school2_school1_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school3_school2_school1_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +Absolute deviation outbound distance child123 Chauffer 1,abs_dev_dist_out_child123_chauf1,"np.maximum(_min_dist_dropoff_order_out_child123_chauf1 - dist_home_to_mand1, 0)" +,_dist_school1_school2_school3_mand2,"dist_home_to_school1 + _dist_school1_to_school2 + _dist_school2_to_school3 + _dist_school3_to_mand2" +,_dist_school1_school3_school2_mand2,"dist_home_to_school1 + _dist_school1_to_school3 + _dist_school3_to_school2 + _dist_school2_to_mand2" +,_dist_school2_school1_school3_mand2,"dist_home_to_school2 + _dist_school2_to_school1 + _dist_school1_to_school3 + _dist_school3_to_mand2" +,_dist_school2_school3_school1_mand2,"dist_home_to_school2 + _dist_school2_to_school3 + _dist_school3_to_school1 + _dist_school1_to_mand2" +,_dist_school3_school1_school2_mand2,"dist_home_to_school3 + _dist_school3_to_school1 + _dist_school1_to_school2 + _dist_school2_to_mand2" +,_dist_school3_school2_school1_mand2,"dist_home_to_school3 + _dist_school3_to_school2 + _dist_school2_to_school1 + _dist_school1_to_mand2" +,_min_dist_dropoff_order_out_child123_chauf2,_dist_school1_school2_school3_mand2 +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school1_school3_school2_mand2 > 0) & (_dist_school1_school3_school2_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school1_school3_school2_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school2_school1_school3_mand2 > 0) & (_dist_school2_school1_school3_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school2_school1_school3_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school2_school3_school1_mand2 > 0) & (_dist_school2_school3_school1_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school2_school3_school1_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school3_school1_school2_mand2 > 0) & (_dist_school3_school1_school2_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school3_school1_school2_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school3_school2_school1_mand2 > 0) & (_dist_school3_school2_school1_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school3_school2_school1_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +Absolute deviation outbound distance child123 Chauffer 1,abs_dev_dist_out_child123_chauf2,"np.maximum(_min_dist_dropoff_order_out_child123_chauf2 - dist_home_to_mand2, 0)" +# Availability for multiple bundles,, +,_return_min_taking_child1,"(pref_depart_time_school1 * mins_per_time_bin) + time_home_to_school1 + time_school_to_home1" +,_return_min_taking_child2,"(pref_depart_time_school2 * mins_per_time_bin) + time_home_to_school2 + time_school_to_home2" +,_return_min_taking_child3,"(pref_depart_time_school3 * mins_per_time_bin) + time_home_to_school3 + time_school_to_home3" +Availability of taking child 1 and then 2,_avail_child1_then_child2,"(_return_min_taking_child1 < (pref_depart_time_school2 * mins_per_time_bin))" +Availability of taking child 2 and then 1,_avail_child2_then_child1,"(_return_min_taking_child2 < (pref_depart_time_school1 * mins_per_time_bin))" +Availability of taking child 1 and then 3,_avail_child1_then_child3,"(_return_min_taking_child1 < (pref_depart_time_school3 * mins_per_time_bin))" +Availability of taking child 3 and then 1,_avail_child3_then_child1,"(_return_min_taking_child3 < (pref_depart_time_school1 * mins_per_time_bin))" +Availability of taking child 2 and then 3,_avail_child2_then_child3,"(_return_min_taking_child2 < (pref_depart_time_school3 * mins_per_time_bin))" +Availability of taking child 3 and then 2,_avail_child3_then_child2,"(_return_min_taking_child3 < (pref_depart_time_school2 * mins_per_time_bin))" +multiple_bundle_availability,avail_multiple_bundles,(_avail_child1_then_child2 | _avail_child2_then_child1 | _avail_child1_then_child3 | _avail_child3_then_child1 | _avail_child2_then_child3 | _avail_child3_then_child2) +# ,, +# Inbound specific terms ,, +Preferred return time from school - child 1,pref_return_time_school1,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').end, df.child_id1)" +Preferred return time from school - child 2,pref_return_time_school2,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').end, df.child_id2)" +Preferred return time from school - child 3,pref_return_time_school3,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').end, df.child_id3)" +Preferred return time from work / univ - chauffer 1,pref_return_time_chauf1,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').end, df.chauf_id1)" +Preferred return time from work / univ - chauffer 2,pref_return_time_chauf2,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').end, df.chauf_id2)" diff --git a/activitysim/examples/prototype_mtc_extended/configs/school_escorting_preprocessor_outbound_cond.csv b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_preprocessor_outbound_cond.csv new file mode 100644 index 0000000000..ede805b097 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/school_escorting_preprocessor_outbound_cond.csv @@ -0,0 +1,138 @@ +Description,Target,Expression +Number of children going to school,num_children_going_to_school,"np.where(df['child_id1'] > 0, 1, 0) + np.where(df['child_id2'] > 0, 1, 0) + np.where(df['child_id3'] > 0,1,0)" +Number of potential chauffeurs,num_potential_chauffeurs,"np.where(df['chauf_id1'] > 0, 1, 0) + np.where(df['chauf_id2'] > 0, 1, 0)" +Person Type - chauffer 1,ptype_chauf1,"reindex(persons.ptype, df.chauf_id1)" +Person Type - chauffer 2,ptype_chauf2,"reindex(persons.ptype, df.chauf_id2)" +Gender - chauffer 1,gender_chauf1,"reindex(persons.sex, df.chauf_id1)" +Gender - chauffer 2,gender_chauf2,"reindex(persons.sex, df.chauf_id2)" +Age - chauffer 1,age_chauf1,"reindex(persons.age, df.chauf_id1)" +Age - chauffer 2,age_chauf2,"reindex(persons.age, df.chauf_id2)" +Daily activity pattern - chauffer 1,cdap_chauf1,"reindex(persons.cdap_activity, df.chauf_id1)" +Daily activity pattern - chauffer 2,cdap_chauf2,"reindex(persons.cdap_activity, df.chauf_id2)" +Age - child 1,age_child1,"reindex(persons.age, df.child_id1)" +Age - child 2,age_child2,"reindex(persons.age, df.child_id2)" +Age - child 3,age_child3,"reindex(persons.age, df.child_id3)" +# Departure times to school and work +Preferred departure time to school - child 1,pref_depart_time_school1,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').start, df.child_id1)" +Preferred departure time to school - child 2,pref_depart_time_school2,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').start, df.child_id2)" +Preferred departure time to school - child 3,pref_depart_time_school3,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').start, df.child_id3)" +Preferred departure time to work / univ - chauffer 1,pref_depart_time_chauf1,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').start, df.chauf_id1)" +Preferred departure time to work / univ - chauffer 2,pref_depart_time_chauf2,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').start, df.chauf_id2)" +# Distances and times to school and work +School location - child 1,school_location_child1,"reindex(persons.school_zone_id, df.child_id1)" +School location - child 2,school_location_child2,"reindex(persons.school_zone_id, df.child_id2)" +School location - child 3,school_location_child3,"reindex(persons.school_zone_id, df.child_id3)" +School location - chauffer 1,_school_location_chauf1,"reindex(persons.workplace_zone_id, df.chauf_id1)" +School location - chauffer 2,_school_location_chauf2,"reindex(persons.workplace_zone_id, df.chauf_id2)" +Work location - chauffer 1,_work_location_chauf1,"reindex(persons.workplace_zone_id, df.chauf_id1)" +Work location - chauffer 2,_work_location_chauf2,"reindex(persons.workplace_zone_id, df.chauf_id2)" +Mandatory tour location - chauffer 1,_mandatory_location_chauf1,"_school_location_chauf1.where(ptype_chauf1 == 3, _work_location_chauf1)" +Mandatory tour location - chauffer 2,_mandatory_location_chauf2,"_school_location_chauf1.where(ptype_chauf2 == 3, _work_location_chauf2)" +# creating valid school locations to pass to skim_dict,, +,_valid_school_location_child1,school_location_child1.fillna(persons[persons.school_zone_id > 0].school_zone_id.mode()[0]) +,_valid_school_location_child2,school_location_child2.fillna(persons[persons.school_zone_id > 0].school_zone_id.mode()[0]) +,_valid_school_location_child3,school_location_child3.fillna(persons[persons.school_zone_id > 0].school_zone_id.mode()[0]) +,_valid_mandatory_location_chauf1,_mandatory_location_chauf1.fillna(persons[persons.workplace_zone_id > 0].workplace_zone_id.mode()[0]) +,_valid_mandatory_location_chauf2,_mandatory_location_chauf2.fillna(persons[persons.workplace_zone_id > 0].workplace_zone_id.mode()[0]) +Auto time home to school - child 1,time_home_to_school1,"np.where(school_location_child1 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child1, ('SOV_TIME', 'AM')), 0)" +Auto time home to school - child 2,time_home_to_school2,"np.where(school_location_child2 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child2, ('SOV_TIME', 'AM')), 0)" +Auto time home to school - child 3,time_home_to_school3,"np.where(school_location_child3 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child3, ('SOV_TIME', 'AM')), 0)" +Auto time school to home - child 1,time_school_to_home1,"np.where(school_location_child1 > 0, skim_dict.lookup(_valid_school_location_child1, df.home_zone_id, ('SOV_TIME', 'AM')), 0)" +Auto time school to home - child 2,time_school_to_home2,"np.where(school_location_child2 > 0, skim_dict.lookup(_valid_school_location_child2, df.home_zone_id, ('SOV_TIME', 'AM')), 0)" +Auto time school to home - child 3,time_school_to_home3,"np.where(school_location_child3 > 0, skim_dict.lookup(_valid_school_location_child3, df.home_zone_id, ('SOV_TIME', 'AM')), 0)" +Auto dist home to school - child 1,dist_home_to_school1,"np.where(school_location_child1 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child1, ('SOV_DIST', 'AM')), 0)" +Auto dist home to school - child 2,dist_home_to_school2,"np.where(school_location_child2 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child2, ('SOV_DIST', 'AM')), 0)" +Auto dist home to school - child 3,dist_home_to_school3,"np.where(school_location_child3 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child3, ('SOV_DIST', 'AM')), 0)" +Auto dist intra school taz - child 1,dist_intra_school1,"np.where(school_location_child1 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child1, ('SOV_DIST', 'AM')), 0)" +Auto dist intra school taz - child 2,dist_intra_school2,"np.where(school_location_child2 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child2, ('SOV_DIST', 'AM')), 0)" +Auto dist intra school taz - child 3,dist_intra_school3,"np.where(school_location_child3 > 0, skim_dict.lookup(df.home_zone_id, _valid_school_location_child3, ('SOV_DIST', 'AM')), 0)" +Auto time home to work or university - chauffer 1,time_home_to_mand1,"np.where(_mandatory_location_chauf1 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf1, ('SOV_TIME', 'AM')), 0)" +Auto time home to work or university - chauffer 2,time_home_to_mand2,"np.where(_mandatory_location_chauf2 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf2, ('SOV_TIME', 'AM')), 0)" +Auto dist home to work or university - chauffer 1,dist_home_to_mand1,"np.where(_mandatory_location_chauf1 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf1, ('SOV_DIST', 'AM')), 0)" +Auto dist home to work or university - chauffer 2,dist_home_to_mand2,"np.where(_mandatory_location_chauf2 > 0, skim_dict.lookup(df.home_zone_id, _valid_mandatory_location_chauf2, ('SOV_DIST', 'AM')), 0)" +# outbound distance combinations between chauffeurs and children,, +Distance from child 1 school to chauffeur 1 mandatory location,_dist_school1_to_mand1,"np.where((school_location_child1 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_mandatory_location_chauf1, ('SOV_TIME', 'AM')), 0)" +Distance from child 1 school to chauffeur 2 mandatory location,_dist_school1_to_mand2,"np.where((school_location_child1 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_mandatory_location_chauf2, ('SOV_TIME', 'AM')), 0)" +Distance from child 2 school to chauffeur 1 mandatory location,_dist_school2_to_mand1,"np.where((school_location_child2 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_mandatory_location_chauf1, ('SOV_TIME', 'AM')), 0)" +Distance from child 2 school to chauffeur 2 mandatory location,_dist_school2_to_mand2,"np.where((school_location_child2 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_mandatory_location_chauf2, ('SOV_TIME', 'AM')), 0)" +Distance from child 3 school to chauffeur 1 mandatory location,_dist_school3_to_mand1,"np.where((school_location_child3 > 0) & (_mandatory_location_chauf1 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_mandatory_location_chauf1, ('SOV_TIME', 'AM')), 0)" +Distance from child 3 school to chauffeur 2 mandatory location,_dist_school3_to_mand2,"np.where((school_location_child3 > 0) & (_mandatory_location_chauf2 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_mandatory_location_chauf2, ('SOV_TIME', 'AM')), 0)" +Distance from child 1 school to child 2 school,_dist_school1_to_school2,"np.where((school_location_child1 > 0) & (school_location_child2 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_school_location_child2, ('SOV_TIME', 'AM')), 0)" +Distance from child 1 school to child 3 school,_dist_school1_to_school3,"np.where((school_location_child1 > 0) & (school_location_child3 > 0), skim_dict.lookup(_valid_school_location_child1, _valid_school_location_child3, ('SOV_TIME', 'AM')), 0)" +Distance from child 2 school to child 3 school,_dist_school2_to_school3,"np.where((school_location_child2 > 0) & (school_location_child3 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_school_location_child3, ('SOV_TIME', 'AM')), 0)" +Distance from child 2 school to child 1 school,_dist_school2_to_school1,"np.where((school_location_child2 > 0) & (school_location_child1 > 0), skim_dict.lookup(_valid_school_location_child2, _valid_school_location_child1, ('SOV_TIME', 'AM')), 0)" +Distance from child 3 school to child 1 school,_dist_school3_to_school1,"np.where((school_location_child3 > 0) & (school_location_child1 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_school_location_child1, ('SOV_TIME', 'AM')), 0)" +Distance from child 3 school to child 2 school,_dist_school3_to_school2,"np.where((school_location_child3 > 0) & (school_location_child2 > 0), skim_dict.lookup(_valid_school_location_child3, _valid_school_location_child2, ('SOV_TIME', 'AM')), 0)" +# absolute deviation distance outbound,, +Absolute deviation outbound distance Child 1 Chauffer 1,abs_dev_dist_out_child1_chauf1,"np.maximum(dist_home_to_school1 + _dist_school1_to_mand1 - dist_home_to_mand1,0)" +Absolute deviation outbound distance Child 1 Chauffer 2,abs_dev_dist_out_child1_chauf2,"np.maximum(dist_home_to_school1 + _dist_school1_to_mand2 - dist_home_to_mand2,0)" +Absolute deviation outbound distance Child 2 Chauffer 1,abs_dev_dist_out_child2_chauf1,"np.maximum(dist_home_to_school2 + _dist_school2_to_mand1 - dist_home_to_mand1,0)" +Absolute deviation outbound distance Child 2 Chauffer 2,abs_dev_dist_out_child2_chauf2,"np.maximum(dist_home_to_school2 + _dist_school2_to_mand2 - dist_home_to_mand2,0)" +Absolute deviation outbound distance Child 3 Chauffer 1,abs_dev_dist_out_child3_chauf1,"np.maximum(dist_home_to_school3 + _dist_school3_to_mand1 - dist_home_to_mand1,0)" +Absolute deviation outbound distance Child 3 Chauffer 2,abs_dev_dist_out_child3_chauf2,"np.maximum(dist_home_to_school3 + _dist_school3_to_mand2 - dist_home_to_mand2,0)" +Absolute deviation outbound distance child12 Chauffer 1,abs_dev_dist_out_child12_chauf1,"np.maximum(np.minimum(dist_home_to_school1 + _dist_school1_to_school2 + _dist_school2_to_mand1, dist_home_to_school2 + _dist_school2_to_school1 + _dist_school1_to_mand1) - dist_home_to_mand1, 0)" +Absolute deviation outbound distance child12 Chauffer 2,abs_dev_dist_out_child12_chauf2,"np.maximum(np.minimum(dist_home_to_school1 + _dist_school1_to_school2 + _dist_school2_to_mand2, dist_home_to_school2 + _dist_school2_to_school1 + _dist_school1_to_mand2) - dist_home_to_mand2, 0)" +Absolute deviation outbound distance child13 Chauffer 1,abs_dev_dist_out_child13_chauf1,"np.maximum(np.minimum(dist_home_to_school1 + _dist_school1_to_school3 + _dist_school3_to_mand1, dist_home_to_school3 + _dist_school3_to_school1 + _dist_school1_to_mand1) - dist_home_to_mand1, 0)" +Absolute deviation outbound distance child13 Chauffer 2,abs_dev_dist_out_child13_chauf2,"np.maximum(np.minimum(dist_home_to_school1 + _dist_school1_to_school3 + _dist_school3_to_mand2, dist_home_to_school3 + _dist_school3_to_school1 + _dist_school1_to_mand2) - dist_home_to_mand2, 0)" +Absolute deviation outbound distance child23 Chauffer 1,abs_dev_dist_out_child23_chauf1,"np.maximum(np.minimum(dist_home_to_school2 + _dist_school2_to_school3 + _dist_school3_to_mand1, dist_home_to_school3 + _dist_school3_to_school2 + _dist_school2_to_mand1) - dist_home_to_mand1, 0)" +Absolute deviation outbound distance child23 Chauffer 2,abs_dev_dist_out_child23_chauf2,"np.maximum(np.minimum(dist_home_to_school2 + _dist_school2_to_school3 + _dist_school3_to_mand2, dist_home_to_school3 + _dist_school3_to_school2 + _dist_school2_to_mand2) - dist_home_to_mand2, 0)" +,_dist_school1_school2_school3_mand1,"dist_home_to_school1 + _dist_school1_to_school2 + _dist_school2_to_school3 + _dist_school3_to_mand1" +,_dist_school1_school3_school2_mand1,"dist_home_to_school1 + _dist_school1_to_school3 + _dist_school3_to_school2 + _dist_school2_to_mand1" +,_dist_school2_school1_school3_mand1,"dist_home_to_school2 + _dist_school2_to_school1 + _dist_school1_to_school3 + _dist_school3_to_mand1" +,_dist_school2_school3_school1_mand1,"dist_home_to_school2 + _dist_school2_to_school3 + _dist_school3_to_school1 + _dist_school1_to_mand1" +,_dist_school3_school1_school2_mand1,"dist_home_to_school3 + _dist_school3_to_school1 + _dist_school1_to_school2 + _dist_school2_to_mand1" +,_dist_school3_school2_school1_mand1,"dist_home_to_school3 + _dist_school3_to_school2 + _dist_school2_to_school1 + _dist_school1_to_mand1" +,_min_dist_dropoff_order_out_child123_chauf1,_dist_school1_school2_school3_mand1 +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school1_school3_school2_mand1 > 0) & (_dist_school1_school3_school2_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school1_school3_school2_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school2_school1_school3_mand1 > 0) & (_dist_school2_school1_school3_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school2_school1_school3_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school2_school3_school1_mand1 > 0) & (_dist_school2_school3_school1_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school2_school3_school1_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school3_school1_school2_mand1 > 0) & (_dist_school3_school1_school2_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school3_school1_school2_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +,_min_dist_dropoff_order_out_child123_chauf1,"np.where((_dist_school3_school2_school1_mand1 > 0) & (_dist_school3_school2_school1_mand1 < _min_dist_dropoff_order_out_child123_chauf1), _dist_school3_school2_school1_mand1, _min_dist_dropoff_order_out_child123_chauf1)" +Absolute deviation outbound distance child123 Chauffer 1,abs_dev_dist_out_child123_chauf1,"np.maximum(_min_dist_dropoff_order_out_child123_chauf1 - dist_home_to_mand1, 0)" +,_dist_school1_school2_school3_mand2,"dist_home_to_school1 + _dist_school1_to_school2 + _dist_school2_to_school3 + _dist_school3_to_mand2" +,_dist_school1_school3_school2_mand2,"dist_home_to_school1 + _dist_school1_to_school3 + _dist_school3_to_school2 + _dist_school2_to_mand2" +,_dist_school2_school1_school3_mand2,"dist_home_to_school2 + _dist_school2_to_school1 + _dist_school1_to_school3 + _dist_school3_to_mand2" +,_dist_school2_school3_school1_mand2,"dist_home_to_school2 + _dist_school2_to_school3 + _dist_school3_to_school1 + _dist_school1_to_mand2" +,_dist_school3_school1_school2_mand2,"dist_home_to_school3 + _dist_school3_to_school1 + _dist_school1_to_school2 + _dist_school2_to_mand2" +,_dist_school3_school2_school1_mand2,"dist_home_to_school3 + _dist_school3_to_school2 + _dist_school2_to_school1 + _dist_school1_to_mand2" +,_min_dist_dropoff_order_out_child123_chauf2,_dist_school1_school2_school3_mand2 +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school1_school3_school2_mand2 > 0) & (_dist_school1_school3_school2_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school1_school3_school2_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school2_school1_school3_mand2 > 0) & (_dist_school2_school1_school3_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school2_school1_school3_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school2_school3_school1_mand2 > 0) & (_dist_school2_school3_school1_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school2_school3_school1_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school3_school1_school2_mand2 > 0) & (_dist_school3_school1_school2_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school3_school1_school2_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +,_min_dist_dropoff_order_out_child123_chauf2,"np.where((_dist_school3_school2_school1_mand2 > 0) & (_dist_school3_school2_school1_mand2 < _min_dist_dropoff_order_out_child123_chauf2), _dist_school3_school2_school1_mand2, _min_dist_dropoff_order_out_child123_chauf2)" +Absolute deviation outbound distance child123 Chauffer 1,abs_dev_dist_out_child123_chauf2,"np.maximum(_min_dist_dropoff_order_out_child123_chauf2 - dist_home_to_mand2, 0)" +# Availability for multiple bundles,, +,_return_min_taking_child1,"(pref_depart_time_school1 * mins_per_time_bin) + time_home_to_school1 + time_school_to_home1" +,_return_min_taking_child2,"(pref_depart_time_school2 * mins_per_time_bin) + time_home_to_school2 + time_school_to_home2" +,_return_min_taking_child3,"(pref_depart_time_school3 * mins_per_time_bin) + time_home_to_school3 + time_school_to_home3" +Availability of taking child 1 and then 2,_avail_child1_then_child2,"(_return_min_taking_child1 < (pref_depart_time_school2 * mins_per_time_bin))" +Availability of taking child 2 and then 1,_avail_child2_then_child1,"(_return_min_taking_child2 < (pref_depart_time_school1 * mins_per_time_bin))" +Availability of taking child 1 and then 3,_avail_child1_then_child3,"(_return_min_taking_child1 < (pref_depart_time_school3 * mins_per_time_bin))" +Availability of taking child 3 and then 1,_avail_child3_then_child1,"(_return_min_taking_child3 < (pref_depart_time_school1 * mins_per_time_bin))" +Availability of taking child 2 and then 3,_avail_child2_then_child3,"(_return_min_taking_child2 < (pref_depart_time_school3 * mins_per_time_bin))" +Availability of taking child 3 and then 2,_avail_child3_then_child2,"(_return_min_taking_child3 < (pref_depart_time_school2 * mins_per_time_bin))" +multiple_bundle_availability,avail_multiple_bundles,(_avail_child1_then_child2 | _avail_child2_then_child1 | _avail_child1_then_child3 | _avail_child3_then_child1 | _avail_child2_then_child3 | _avail_child3_then_child2) +# ,, +# Inbound specific terms ,, +Preferred return time from school - child 1,pref_return_time_school1,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').end, df.child_id1)" +Preferred return time from school - child 2,pref_return_time_school2,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').end, df.child_id2)" +Preferred return time from school - child 3,pref_return_time_school3,"reindex(tours[(tours.tour_type == 'school') & (tours.tour_num == 1)].set_index('person_id').end, df.child_id3)" +Preferred return time from work / univ - chauffer 1,pref_return_time_chauf1,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').end, df.chauf_id1)" +Preferred return time from work / univ - chauffer 2,pref_return_time_chauf2,"reindex(tours[(tours.tour_category == 'mandatory') & (tours.tour_num == 1)].set_index('person_id').end, df.chauf_id2)" +# overlapping time windows from inbound escorting,, +# ,_return_min_taking_inbound_child1_pe,"(_pref_depart_time_to_school1 * mins_per_time_bin) + time_home_to_school1 + time_school_to_home1" +# ,_return_min_taking_inbound_child2_pe,"(_pref_depart_time_to_school2 * mins_per_time_bin) + time_home_to_school2 + time_school_to_home2" +# ,_return_min_taking_inbound_child3_pe,"(_pref_depart_time_to_school3 * mins_per_time_bin) + time_home_to_school3 + time_school_to_home3" +# finding earliest time chauffer 1 returns from inbound pure escort tour,inbound_pe_return_time_home_chauf1,-1 +# ,inbound_pe_return_time_home_chauf1,"np.where((df.chauf1_inbound == 2) & (_return_min_taking_inbound_child1_pe > inbound_pe_return_time_home_chauf1), _return_min_taking_inbound_child1_pe, inbound_pe_return_time_home_chauf1)" +# ,inbound_pe_return_time_home_chauf1,"np.where((df.chauf2_inbound == 2) & (_return_min_taking_inbound_child2_pe > inbound_pe_return_time_home_chauf1), _return_min_taking_inbound_child2_pe, inbound_pe_return_time_home_chauf1)" +# ,inbound_pe_return_time_home_chauf1,"np.where((df.chauf3_inbound == 2) & (_return_min_taking_inbound_child3_pe > inbound_pe_return_time_home_chauf1), _return_min_taking_inbound_child3_pe, inbound_pe_return_time_home_chauf1)" +# finding earliest time chauffer 2 returns from inbound pure escort tour,inbound_pe_return_time_home_chauf2,-1 +# ,inbound_pe_return_time_home_chauf2,"np.where((df.chauf1_inbound == 2) & (_return_min_taking_inbound_child1_pe > inbound_pe_return_time_home_chauf2), _return_min_taking_inbound_child1_pe, inbound_pe_return_time_home_chauf2)" +# ,inbound_pe_return_time_home_chauf2,"np.where((df.chauf2_inbound == 2) & (_return_min_taking_inbound_child2_pe > inbound_pe_return_time_home_chauf2), _return_min_taking_inbound_child2_pe, inbound_pe_return_time_home_chauf2)" +# ,inbound_pe_return_time_home_chauf2,"np.where((df.chauf3_inbound == 2) & (_return_min_taking_inbound_child3_pe > inbound_pe_return_time_home_chauf2), _return_min_taking_inbound_child3_pe, inbound_pe_return_time_home_chauf2)" +# finding latest time chauffer 1 returns from inbound ride share tour,inbound_rs_return_time_home_chauf1,pref_depart_time_chauf1 +# finding latest time chauffer 2 returns from inbound ride share tour,inbound_rs_return_time_home_chauf2,pref_depart_time_chauf2 +# return time of inbound school escoring tour - chauffeur 1,return_bin_inbound_school_escorting1,"np.where(df.nrs1_inbound > 0, pref_depart_time_chauf1, inbound_pe_return_time_home_chauf1)" +# return time of inbound school escoring tour - chauffeur 2,return_bin_inbound_school_escorting2,"np.where(df.nrs2_inbound > 0, pref_depart_time_chauf2, inbound_pe_return_time_home_chauf2)" diff --git a/activitysim/examples/prototype_mtc_extended/configs/settings.yaml b/activitysim/examples/prototype_mtc_extended/configs/settings.yaml index 17881f2d75..bed765856b 100644 --- a/activitysim/examples/prototype_mtc_extended/configs/settings.yaml +++ b/activitysim/examples/prototype_mtc_extended/configs/settings.yaml @@ -193,6 +193,7 @@ models: - cdap_simulate - mandatory_tour_frequency - mandatory_tour_scheduling + - school_escorting - joint_tour_frequency - joint_tour_composition - joint_tour_participation diff --git a/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_escort.csv b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_escort.csv new file mode 100644 index 0000000000..40e0f4145f --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_escort.csv @@ -0,0 +1,29 @@ +Description,value,coefficient_name +Number of HH Persons,-0.24,coef_number_of_hh_persons +Number of Students in HH,0.19,coef_number_of_students_in_hh +Dummy for all stops made by transit,-0.7,coef_dummy_for_all_stops_made_by_transit +Dummy for walking to all stops,-1.91,coef_dummy_for_walking_to_all_stops +Number of work tours undertaken by the person,-0.29,coef_number_of_work_tours_undertaken_by_the_person +Number of escort tours tours undertaken by the person,-0.15,coef_number_of_escort_tours_tours_undertaken_by_the_person +Dummy for the duration of the tour being equal or greater than or equal to 9 hours ,0.59,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_ +dummy for distance less than 5 Miles,0.32,coef_dummy_for_distance_less_than_5_miles +dummy for distance in miles,0.01,coef_dummy_for_distance_in_miles +No stops if tour mode is driveTransit,-999,coef_no_stops_if_tour_mode_is_drivetransit +Alternative specific constant for return stops,-0.968,coef_alternative_specific_constant_for_return_stops_0out_1in +Alternative specific constant for return stops on joint tours,-1.329,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_1in +Alternative specific constant for return stops,-2.41,coef_alternative_specific_constant_for_return_stops_0out_2in +Alternative specific constant for the total number of stops,0,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in +Alternative specific constant for return stops on joint tours,-2.796,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_2in +Alternative specific constant for the total number of stops on joint tours,0,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_0out_2in +Alternative specific constant for return stops,-3.024,coef_alternative_specific_constant_for_return_stops_0out_3in +Alternative specific constant for return stops on joint tours,-3.379,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_3in +Alternative specific constant for outbound stops,-2.173,coef_alternative_specific_constant_for_outbound_stops_1out_0in +Alternative specific constant for outbound stops on joint tours,-1.783,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_1out_0in +Alternative specific constant for the total number of stops on joint tours,0.518,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_1out_3in +Alternative specific constant for outbound stops,-4.294,coef_alternative_specific_constant_for_outbound_stops_2out_0in +Alternative specific constant for outbound stops on joint tours,-4.067,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_2out_0in +Alternative specific constant for the total number of stops,-1.807,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in +Alternative specific constant for the total number of stops on joint tours,1.497,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_2out_3in +Alternative specific constant for outbound stops,-4.758,coef_alternative_specific_constant_for_outbound_stops_3out_0in +Alternative specific constant for outbound stops on joint tours,-4.998,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_3out_0in +Unavailable,-999,coef_unavail diff --git a/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_school.csv b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_school.csv new file mode 100644 index 0000000000..8efa5941f7 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_school.csv @@ -0,0 +1,22 @@ +Description,value,coefficient_name +Number of HH Persons,-0.506,coef_number_of_hh_persons +Presence of kids between 5 and 15 (including) years old,0.3299,coef_presence_of_kids_between_5_and_15_including_years_old +Number of Cars > Number of Workers,0.5331,coef_number_of_cars_number_of_workers +Dummy for female,0.4099,coef_dummy_for_female +Dummy for all stops made by transit,-0.7,coef_dummy_for_all_stops_made_by_transit +Dummy for walking to all stops,-1.8163,coef_dummy_for_walking_to_all_stops +Number of escort tours tours undertaken by the person,1.2365,coef_number_of_escort_tours_tours_undertaken_by_the_person +Arrival later than 17:00.,1.8377,coef_arrival_later_than_17_00_ +Dummy for the duration of the tour being equal or greater than or equal to 9 hours ,0.9549,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_ +dummy for distance in miles,0.0438,coef_dummy_for_distance_in_miles +No stops if tour mode is driveTransit,-999.0,coef_no_stops_if_tour_mode_is_drivetransit +Alternative specific constant for return stops,-1.206,coef_alternative_specific_constant_for_return_stops_0out_1in +Alternative specific constant for return stops,-2.6719999999999997,coef_alternative_specific_constant_for_return_stops_0out_2in +Alternative specific constant for the total number of stops,0.0,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in +Alternative specific constant for return stops,-3.364,coef_alternative_specific_constant_for_return_stops_0out_3in +Alternative specific constant for outbound stops,-2.123,coef_alternative_specific_constant_for_outbound_stops_1out_0in +Alternative specific constant for the total number of stops,0.701,coef_alternative_specific_constant_for_the_total_number_of_stops_1out_3in +Alternative specific constant for outbound stops,-3.798,coef_alternative_specific_constant_for_outbound_stops_2out_0in +Alternative specific constant for the total number of stops,1.135,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in +Alternative specific constant for outbound stops,-5.85,coef_alternative_specific_constant_for_outbound_stops_3out_0in +Coefficient for unavailable alternatives,-999,coef_unavail \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_univ.csv b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_univ.csv new file mode 100644 index 0000000000..b074f4087e --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_univ.csv @@ -0,0 +1,21 @@ +Description,value,coefficient_name +Number of HH Persons,-0.2827,coef_number_of_hh_persons +Presence of kids between 5 and 15 (including) years old,0.6823,coef_presence_of_kids_between_5_and_15_including_years_old +Number of Vehicles,0.1703,coef_number_of_vehicles +Dummy for female,0.7349,coef_dummy_for_female +Dummy for all stops made by transit,-0.7,coef_dummy_for_all_stops_made_by_transit +Number of escort tours tours undertaken by the person,0.9018,coef_number_of_escort_tours_tours_undertaken_by_the_person +Arrival later than 17:00.,0.389,coef_arrival_later_than_17_00_ +Dummy for the duration of the tour being equal or greater than or equal to 9 hours ,0.8434,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_ +HH accesibility for inbound tours. Interaction,0.2481,coef_hh_accesibility_for_inbound_tours_interaction +No stops if tour mode is driveTransit,-999.0,coef_no_stops_if_tour_mode_is_drivetransit +Alternative specific constant for return stops,-2.003,coef_alternative_specific_constant_for_return_stops_0out_1in +Alternative specific constant for return stops,-3.51,coef_alternative_specific_constant_for_return_stops_0out_2in +Alternative specific constant for the total number of stops,0.0,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in +Alternative specific constant for return stops,-3.677,coef_alternative_specific_constant_for_return_stops_0out_3in +Alternative specific constant for outbound stops,-2.628,coef_alternative_specific_constant_for_outbound_stops_1out_0in +Alternative specific constant for the total number of stops,1.272,coef_alternative_specific_constant_for_the_total_number_of_stops_1out_3in +Alternative specific constant for outbound stops,-3.741,coef_alternative_specific_constant_for_outbound_stops_2out_0in +Alternative specific constant for the total number of stops,1.871,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in +Alternative specific constant for outbound stops,-4.981,coef_alternative_specific_constant_for_outbound_stops_3out_0in +Coefficient for unavailable alternatives,-999,coef_unavail \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_work.csv b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_work.csv new file mode 100644 index 0000000000..61008890fb --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_coefficients_work.csv @@ -0,0 +1,35 @@ +Description,value,coefficient_name +Middle to Low Income HH,0.17,coef_middle_to_low_income_hh +Mid to High Income HH,0.23,coef_mid_to_high_income_hh +High Income HH,0.24,coef_high_income_hh +Number of HH Persons,-0.31,coef_number_of_hh_persons +Number of Students in HH,0.21,coef_number_of_students_in_hh +Presence of Kids between 0 and 4 (including) years old,0.74,coef_presence_of_kids_between_0_and_4_including_years_old +Num kids between 5 and 15 (including) years old,0.08,coef_num_kids_between_5_and_15_including_years_old +Presence of kids between 5 and 15 (including) years old,0.26,coef_presence_of_kids_between_5_and_15_including_years_old +Number of Adults (>= 16 years old),0.03,coef_number_of_adults_16_years_old_ +Number of Cars > Number of Workers,0.16,coef_number_of_cars_number_of_workers +Dummy for female,0.22,coef_dummy_for_female +Dummy for all stops made by transit,-0.7,coef_dummy_for_all_stops_made_by_transit +Dummy for walking to all stops,-1.54,coef_dummy_for_walking_to_all_stops +Number of work tours undertaken by the person,-0.15,coef_number_of_work_tours_undertaken_by_the_person +Number of university tours tours undertaken by the person,-0.48,coef_number_of_university_tours_tours_undertaken_by_the_person +Number of school tours tours undertaken by the person,-1.55,coef_number_of_school_tours_tours_undertaken_by_the_person +Number of escort tours tours undertaken by the person,0.2,coef_number_of_escort_tours_tours_undertaken_by_the_person +Number of shop tours undertaken by the houshold,-0.05,coef_number_of_shop_tours_undertaken_by_the_houshold +AM Peak departure between 6AM and 7 AM (including) Interacted with outbound tours,-1.93,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours +Evening Arrival (>=19:00) Interacted with return tours,0.31,coef_evening_arrival_19_00_interacted_with_return_tours +Dummy for the duration of the tour being equal or greater than or equal to 11 hours,0.6,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours +dummy for distance less than 20 Miles,-0.22,coef_dummy_for_distance_less_than_20_miles +dummy for distance in miles,0.01,coef_dummy_for_distance_in_miles +No stops if tour mode is driveTransit,-999.0,coef_no_stops_if_tour_mode_is_drivetransit +Alternative specific constant for return stops,-0.445,coef_alternative_specific_constant_for_return_stops_0out_1in +Number of subtours in the tour,0.19,coef_number_of_subtours_in_the_tour +Alternative specific constant for return stops,-1.775,coef_alternative_specific_constant_for_return_stops_0out_2in +Alternative specific constant for the total number of stops,0.0,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in +Alternative specific constant for return stops,-2.1390000000000002,coef_alternative_specific_constant_for_return_stops_0out_3in +Alternative specific constant for outbound stops,-0.833,coef_alternative_specific_constant_for_outbound_stops_1out_0in +Alternative specific constant for outbound stops,-2.613,coef_alternative_specific_constant_for_outbound_stops_2out_0in +Alternative specific constant for the total number of stops,0.695,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in +Alternative specific constant for outbound stops,-3.9339999999999997,coef_alternative_specific_constant_for_outbound_stops_3out_0in +Coefficient for unavailable alternatives,-999,coef_unavail \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_escort.csv b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_escort.csv new file mode 100644 index 0000000000..e522097e5c --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_escort.csv @@ -0,0 +1,49 @@ +Label,Description,Expression,0out_0in,0out_1in,0out_2in,0out_3in,1out_0in,1out_1in,1out_2in,1out_3in,2out_0in,2out_1in,2out_2in,2out_3in,3out_0in,3out_1in,3out_2in,3out_3in +util_middle_to_low_income_hh,Middle to Low Income HH,(income_in_thousands>19999) & (income_in_thousands<50000),,,,,,,,,,,,,,,, +util_mid_to_high_income_hh,Mid to High Income HH,(income_in_thousands>=50000) & (income_in_thousands<100000),,,,,,,,,,,,,,,, +util_high_income_hh,High Income HH,(income_in_thousands>=100000),,,,,,,,,,,,,,,, +util_number_of_hh_persons,Number of HH Persons,hhsize,,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons +util_number_of_full_time_workers_in_hh,Number of full time workers in HH,num_full,,,,,,,,,,,,,,,, +util_number_of_students_in_hh,Number of Students in HH,num_student,,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh +util_num_kids_between_0_and_4_including_years_old,Num Kids between 0 and 4 (including) years old,num_age_0_4,,,,,,,,,,,,,,,, +util_presence_of_kids_between_0_and_4_including_years_old,Presence of Kids between 0 and 4 (including) years old,(num_age_0_4 > 0),,,,,,,,,,,,,,,, +util_num_kids_between_5_and_15_including_years_old,Num kids between 5 and 15 (including) years old,num_age_5_15,,,,,,,,,,,,,,,, +util_presence_of_kids_between_5_and_15_including_years_old,Presence of kids between 5 and 15 (including) years old,(num_age_5_15 > 0),,,,,,,,,,,,,,,, +util_number_of_adults_16_years_old_,Number of Adults (>= 16 years old),num_adult,,,,,,,,,,,,,,,, +util_dummy_for_single_parent_household,Dummy for single parent household,(num_adult == 1) & (num_age_0_4 + num_age_5_15 > 0),,,,,,,,,,,,,,,, +util_number_of_cars_number_of_workers,Number of Cars > Number of Workers,more_cars_than_workers,,,,,,,,,,,,,,,, +util_number_of_vehicles,Number of Vehicles,auto_ownership,,,,,,,,,,,,,,,, +util_dummy_for_female,Dummy for female,female,,,,,,,,,,,,,,,, +util_dummy_for_all_stops_made_by_transit,Dummy for all stops made by transit,tour_mode_is_transit,,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit +util_dummy_for_walking_to_all_stops,Dummy for walking to all stops,tour_mode_is_non_motorized,,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops +util_number_of_work_tours_undertaken_by_the_person,Number of work tours undertaken by the person,num_work_tours,,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person +util_number_of_university_tours_tours_undertaken_by_the_person,Number of university tours tours undertaken by the person,num_univ_tours,,,,,,,,,,,,,,,, +util_number_of_school_tours_tours_undertaken_by_the_person,Number of school tours tours undertaken by the person,num_school_tours,,,,,,,,,,,,,,,, +util_number_of_escort_tours_tours_undertaken_by_the_person,Number of escort tours tours undertaken by the person,num_escort_tours,,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person +util_number_of_shop_tours_undertaken_by_the_person,Number of shop tours undertaken by the person,num_shop_tours,,,,,,,,,,,,,,,, +util_number_of_maintenace_tours_tours_undertaken_by_the_person,Number of maintenace tours tours undertaken by the person,num_maint_tours,,,,,,,,,,,,,,,, +util_number_of_eating_tours_tours_undertaken_by_the_person,Number of eating tours tours undertaken by the person,num_eatout_tours,,,,,,,,,,,,,,,, +util_number_of_visit_tours_tours_undertaken_by_the_person,Number of visit tours tours undertaken by the person,num_social_tours,,,,,,,,,,,,,,,, +util_number_of_shop_tours_undertaken_by_the_houshold,Number of shop tours undertaken by the houshold,num_hh_shop_tours,,,,,,,,,,,,,,,, +util_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,AM Peak departure between 6AM and 7 AM (including) Interacted with outbound tours,(start>5) & (start<8),,,,,,,,,,,,,,,, +util_arrival_later_than_17_00_,Arrival later than 17:00.,(end > 16),,,,,,,,,,,,,,,, +util_evening_arrival_19_00_interacted_with_return_tours,Evening Arrival (>=19:00) Interacted with return tours,(end > 18),,,,,,,,,,,,,,,, +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,Dummy for the duration of the tour being equal or greater than or equal to 11 hours,(duration > 10),,,,,,,,,,,,,,,, +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,Dummy for the duration of the tour being equal or greater than or equal to 9 hours ,(duration > 8),,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_ +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_3_hours_,Dummy for the duration of the tour being equal or greater than or equal to 3 hours ,(duration > 2),,,,,,,,,,,,,,,, +util_hh_accesibility_for_outbound_tours_interaction,HH accesibility for outbound tours. Interaction,hhacc,,,,,,,,,,,,,,,, +util_hh_accesibility_for_inbound_tours_interaction,HH accesibility for inbound tours. Interaction,hhacc,,,,,,,,,,,,,,,, +util_primary_destination_accessibility_for_outbound_tours_interaction,Primary Destination Accessibility for outbound tours. Interaction,pracc,,,,,,,,,,,,,,,, +util_primary_destination_accessibility_for_return_tours_interaction,Primary Destination Accessibility for return tours. Interaction,pracc,,,,,,,,,,,,,,,, +util_dummy_for_distance_less_than_5_miles,dummy for distance less than 5 Miles,(distance_in_miles < 5),,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles,coef_dummy_for_distance_less_than_5_miles +util_dummy_for_distance_in_miles,dummy for distance in miles,distance_in_miles,,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles +util_no_stops_if_tour_mode_is_drivetransit,No stops if tour mode is driveTransit,tour_mode_is_drive_transit,,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit +util_alternative_specific_constant_for_outbound_stops,Alternative specific constant for outbound stops,~is_joint,,,,,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in +util_alternative_specific_constant_for_return_stops,Alternative specific constant for return stops,~is_joint,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in +util_alternative_specific_constant_for_the_total_number_of_stops,Alternative specific constant for the total number of stops,~is_joint,,,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in +util_alternative_specific_constant_for_outbound_stops_on_joint_tours,Alternative specific constant for outbound stops on joint tours,is_joint,,,,,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_1out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_1out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_1out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_1out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_2out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_2out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_2out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_2out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_3out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_3out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_3out_0in,coef_alternative_specific_constant_for_outbound_stops_on_joint_tours_3out_0in +util_alternative_specific_constant_for_return_stops_on_joint_tours,Alternative specific constant for return stops on joint tours,is_joint,,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_1in,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_3in,,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_1in,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_3in,,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_1in,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_3in,,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_1in,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_return_stops_on_joint_tours_0out_3in +util_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours,Alternative specific constant for the total number of stops on joint tours,is_joint,,,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_0out_2in,,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_1out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_1out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_1out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_on_joint_tours_2out_3in +# added for school escorting,,,,,,,,,,,,,,,,,, +util_no_stops_to_school_escorting,Do not allow stops for school escort half-tour -- outbound,"(school_esc_outbound.isin(['ride_share', 'pure_escort']))",,,,,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail +util_no_stops_from_school_escorting,Do not allow stops for school escort half-tour -- inbound,"(school_esc_inbound.isin(['ride_share', 'pure_escort']))",,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail diff --git a/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_school.csv b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_school.csv new file mode 100644 index 0000000000..9aa97f5494 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_school.csv @@ -0,0 +1,46 @@ +Label,Description,Expression,0out_0in,0out_1in,0out_2in,0out_3in,1out_0in,1out_1in,1out_2in,1out_3in,2out_0in,2out_1in,2out_2in,2out_3in,3out_0in,3out_1in,3out_2in,3out_3in +util_middle_to_low_income_hh,Middle to Low Income HH,(income_in_thousands>19999) & (income_in_thousands<50000),,,,,,,,,,,,,,,, +util_mid_to_high_income_hh,Mid to High Income HH,(income_in_thousands>=50000) & (income_in_thousands<100000),,,,,,,,,,,,,,,, +util_high_income_hh,High Income HH,(income_in_thousands>=100000),,,,,,,,,,,,,,,, +util_number_of_hh_persons,Number of HH Persons,hhsize,,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons +util_number_of_full_time_workers_in_hh,Number of full time workers in HH,num_full,,,,,,,,,,,,,,,, +util_number_of_students_in_hh,Number of Students in HH,num_student,,,,,,,,,,,,,,,, +util_num_kids_between_0_and_4_including_years_old,Num Kids between 0 and 4 (including) years old,num_age_0_4,,,,,,,,,,,,,,,, +util_presence_of_kids_between_0_and_4_including_years_old,Presence of Kids between 0 and 4 (including) years old,(num_age_0_4 > 0),,,,,,,,,,,,,,,, +util_num_kids_between_5_and_15_including_years_old,Num kids between 5 and 15 (including) years old,num_age_5_15,,,,,,,,,,,,,,,, +util_presence_of_kids_between_5_and_15_including_years_old,Presence of kids between 5 and 15 (including) years old,(num_age_5_15 > 0),,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old +util_number_of_adults_16_years_old_,Number of Adults (>= 16 years old),num_adult,,,,,,,,,,,,,,,, +util_dummy_for_single_parent_household,Dummy for single parent household,(num_adult == 1) & (num_age_0_4 + num_age_5_15 > 0),,,,,,,,,,,,,,,, +util_number_of_cars_number_of_workers,Number of Cars > Number of Workers,more_cars_than_workers,,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers +util_number_of_vehicles,Number of Vehicles,auto_ownership,,,,,,,,,,,,,,,, +util_dummy_for_female,Dummy for female,female,,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female +util_dummy_for_all_stops_made_by_transit,Dummy for all stops made by transit,tour_mode_is_transit,,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit +util_dummy_for_walking_to_all_stops,Dummy for walking to all stops,tour_mode_is_non_motorized,,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops +util_number_of_work_tours_undertaken_by_the_person,Number of work tours undertaken by the person,num_work_tours,,,,,,,,,,,,,,,, +util_number_of_university_tours_tours_undertaken_by_the_person,Number of university tours tours undertaken by the person,num_univ_tours,,,,,,,,,,,,,,,, +util_number_of_school_tours_tours_undertaken_by_the_person,Number of school tours tours undertaken by the person,num_school_tours,,,,,,,,,,,,,,,, +util_number_of_escort_tours_tours_undertaken_by_the_person,Number of escort tours tours undertaken by the person,num_escort_tours,,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person +util_number_of_shop_tours_undertaken_by_the_person,Number of shop tours undertaken by the person,num_shop_tours,,,,,,,,,,,,,,,, +util_number_of_maintenace_tours_tours_undertaken_by_the_person,Number of maintenace tours tours undertaken by the person,num_maint_tours,,,,,,,,,,,,,,,, +util_number_of_eating_tours_tours_undertaken_by_the_person,Number of eating tours tours undertaken by the person,num_eatout_tours,,,,,,,,,,,,,,,, +util_number_of_visit_tours_tours_undertaken_by_the_person,Number of visit tours tours undertaken by the person,num_social_tours,,,,,,,,,,,,,,,, +util_number_of_shop_tours_undertaken_by_the_houshold,Number of shop tours undertaken by the houshold,num_hh_shop_tours,,,,,,,,,,,,,,,, +util_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,AM Peak departure between 6AM and 7 AM (including) Interacted with outbound tours,(start>5) & (start<8),,,,,,,,,,,,,,,, +util_arrival_later_than_17_00_,Arrival later than 17:00.,(end > 16),,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_ +util_evening_arrival_19_00_interacted_with_return_tours,Evening Arrival (>=19:00) Interacted with return tours,(end > 18),,,,,,,,,,,,,,,, +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,Dummy for the duration of the tour being equal or greater than or equal to 11 hours,(duration > 10),,,,,,,,,,,,,,,, +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,Dummy for the duration of the tour being equal or greater than or equal to 9 hours ,(duration > 8),,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_ +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_3_hours_,Dummy for the duration of the tour being equal or greater than or equal to 3 hours ,(duration > 2),,,,,,,,,,,,,,,, +util_hh_accesibility_for_outbound_tours_interaction,HH accesibility for outbound tours. Interaction,hhacc,,,,,,,,,,,,,,,, +util_hh_accesibility_for_inbound_tours_interaction,HH accesibility for inbound tours. Interaction,hhacc,,,,,,,,,,,,,,,, +util_primary_destination_accessibility_for_outbound_tours_interaction,Primary Destination Accessibility for outbound tours. Interaction,pracc,,,,,,,,,,,,,,,, +util_primary_destination_accessibility_for_return_tours_interaction,Primary Destination Accessibility for return tours. Interaction,pracc,,,,,,,,,,,,,,,, +util_dummy_for_distance_less_than_15_miles,dummy for distance less than 15 Miles,(distance_in_miles < 15),,,,,,,,,,,,,,,, +util_dummy_for_distance_in_miles,dummy for distance in miles,distance_in_miles,,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles +util_no_stops_if_tour_mode_is_drivetransit,No stops if tour mode is driveTransit,tour_mode_is_drive_transit,,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit +util_alternative_specific_constant_for_outbound_stops,Alternative specific constant for outbound stops,1,,,,,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in +util_alternative_specific_constant_for_return_stops,Alternative specific constant for return stops,1,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in +util_alternative_specific_constant_for_the_total_number_of_stops,Alternative specific constant for the total number of stops,1,,,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_1out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_1out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_1out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in +# No stops for half tour that includes school escorting,,,,,,,,,,,,,,,,,, +util_no_stops_to_school_escorting,Do not allow stops for school escort half-tour -- outbound,"(school_esc_outbound.isin(['ride_share', 'pure_escort']))",,,,,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail +util_no_stops_from_school_escorting,Do not allow stops for school escort half-tour -- inbound,"(school_esc_inbound.isin(['ride_share', 'pure_escort']))",,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail diff --git a/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_univ.csv b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_univ.csv new file mode 100644 index 0000000000..8b4b530313 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_univ.csv @@ -0,0 +1,46 @@ +Label,Description,Expression,0out_0in,0out_1in,0out_2in,0out_3in,1out_0in,1out_1in,1out_2in,1out_3in,2out_0in,2out_1in,2out_2in,2out_3in,3out_0in,3out_1in,3out_2in,3out_3in +util_middle_to_low_income_hh,Middle to Low Income HH,(income_in_thousands>19999) & (income_in_thousands<50000),,,,,,,,,,,,,,,, +util_mid_to_high_income_hh,Mid to High Income HH,(income_in_thousands>=50000) & (income_in_thousands<100000),,,,,,,,,,,,,,,, +util_high_income_hh,High Income HH,(income_in_thousands>=100000),,,,,,,,,,,,,,,, +util_number_of_hh_persons,Number of HH Persons,hhsize,,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons +util_number_of_full_time_workers_in_hh,Number of full time workers in HH,num_full,,,,,,,,,,,,,,,, +util_number_of_students_in_hh,Number of Students in HH,num_student,,,,,,,,,,,,,,,, +util_num_kids_between_0_and_4_including_years_old,Num Kids between 0 and 4 (including) years old,num_age_0_4,,,,,,,,,,,,,,,, +util_presence_of_kids_between_0_and_4_including_years_old,Presence of Kids between 0 and 4 (including) years old,(num_age_0_4 > 0),,,,,,,,,,,,,,,, +util_num_kids_between_5_and_15_including_years_old,Num kids between 5 and 15 (including) years old,num_age_5_15,,,,,,,,,,,,,,,, +util_presence_of_kids_between_5_and_15_including_years_old,Presence of kids between 5 and 15 (including) years old,(num_age_5_15 > 0),,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old +util_number_of_adults_16_years_old_,Number of Adults (>= 16 years old),num_adult,,,,,,,,,,,,,,,, +util_dummy_for_single_parent_household,Dummy for single parent household,(num_adult == 1) & (num_age_0_4 + num_age_5_15 > 0),,,,,,,,,,,,,,,, +util_number_of_cars_number_of_workers,Number of Cars > Number of Workers,more_cars_than_workers,,,,,,,,,,,,,,,, +util_number_of_vehicles,Number of Vehicles,auto_ownership,,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles,coef_number_of_vehicles +util_dummy_for_female,Dummy for female,female,,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female +util_dummy_for_all_stops_made_by_transit,Dummy for all stops made by transit,tour_mode_is_transit,,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit +util_dummy_for_walking_to_all_stops,Dummy for walking to all stops,tour_mode_is_non_motorized,,,,,,,,,,,,,,,, +util_number_of_work_tours_undertaken_by_the_person,Number of work tours undertaken by the person,num_work_tours,,,,,,,,,,,,,,,, +util_number_of_university_tours_tours_undertaken_by_the_person,Number of university tours tours undertaken by the person,num_univ_tours,,,,,,,,,,,,,,,, +util_number_of_school_tours_tours_undertaken_by_the_person,Number of school tours tours undertaken by the person,num_school_tours,,,,,,,,,,,,,,,, +util_number_of_escort_tours_tours_undertaken_by_the_person,Number of escort tours tours undertaken by the person,num_escort_tours,,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person +util_number_of_shop_tours_undertaken_by_the_person,Number of shop tours undertaken by the person,num_shop_tours,,,,,,,,,,,,,,,, +util_number_of_maintenace_tours_tours_undertaken_by_the_person,Number of maintenace tours tours undertaken by the person,num_maint_tours,,,,,,,,,,,,,,,, +util_number_of_eating_tours_tours_undertaken_by_the_person,Number of eating tours tours undertaken by the person,num_eatout_tours,,,,,,,,,,,,,,,, +util_number_of_visit_tours_tours_undertaken_by_the_person,Number of visit tours tours undertaken by the person,num_social_tours,,,,,,,,,,,,,,,, +util_number_of_shop_tours_undertaken_by_the_houshold,Number of shop tours undertaken by the houshold,num_hh_shop_tours,,,,,,,,,,,,,,,, +util_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,AM Peak departure between 6AM and 7 AM (including) Interacted with outbound tours,(start>5) & (start<8),,,,,,,,,,,,,,,, +util_arrival_later_than_17_00_,Arrival later than 17:00.,(end > 16),,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_,coef_arrival_later_than_17_00_ +util_evening_arrival_19_00_interacted_with_return_tours,Evening Arrival (>=19:00) Interacted with return tours,(end > 18),,,,,,,,,,,,,,,, +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,Dummy for the duration of the tour being equal or greater than or equal to 11 hours,(duration > 10),,,,,,,,,,,,,,,, +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,Dummy for the duration of the tour being equal or greater than or equal to 9 hours ,(duration > 8),,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_ +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_3_hours_,Dummy for the duration of the tour being equal or greater than or equal to 3 hours ,(duration > 2),,,,,,,,,,,,,,,, +util_hh_accesibility_for_outbound_tours_interaction,HH accesibility for outbound tours. Interaction,hhacc,,,,,,,,,,,,,,,, +util_hh_accesibility_for_inbound_tours_interaction,HH accesibility for inbound tours. Interaction,hhacc,,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction,coef_hh_accesibility_for_inbound_tours_interaction +util_primary_destination_accessibility_for_outbound_tours_interaction,Primary Destination Accessibility for outbound tours. Interaction,pracc,,,,,,,,,,,,,,,, +util_primary_destination_accessibility_for_return_tours_interaction,Primary Destination Accessibility for return tours. Interaction,pracc,,,,,,,,,,,,,,,, +util_dummy_for_distance_less_than_20_miles,dummy for distance less than 20 Miles,(distance_in_miles < 20),,,,,,,,,,,,,,,, +util_dummy_for_distance_in_miles,dummy for distance in miles,distance_in_miles,,,,,,,,,,,,,,,, +util_no_stops_if_tour_mode_is_drivetransit,No stops if tour mode is driveTransit,tour_mode_is_drive_transit,,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit +util_alternative_specific_constant_for_outbound_stops,Alternative specific constant for outbound stops,1,,,,,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in +util_alternative_specific_constant_for_return_stops,Alternative specific constant for return stops,1,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in +util_alternative_specific_constant_for_the_total_number_of_stops,Alternative specific constant for the total number of stops,1,,,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_1out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_1out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_1out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in +# No stops for half tour that includes school escorting,,,,,,,,,,,,,,,,,, +util_no_stops_to_school_escorting,Do not allow stops for school escort half-tour -- outbound,"(school_esc_outbound.isin(['ride_share', 'pure_escort']))",,,,,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail +util_no_stops_from_school_escorting,Do not allow stops for school escort half-tour -- inbound,"(school_esc_inbound.isin(['ride_share', 'pure_escort']))",,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail diff --git a/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_work.csv b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_work.csv new file mode 100644 index 0000000000..764064c837 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/stop_frequency_work.csv @@ -0,0 +1,47 @@ +Label,Description,Expression,0out_0in,0out_1in,0out_2in,0out_3in,1out_0in,1out_1in,1out_2in,1out_3in,2out_0in,2out_1in,2out_2in,2out_3in,3out_0in,3out_1in,3out_2in,3out_3in +util_middle_to_low_income_hh,Middle to Low Income HH,(income_in_thousands>19999) & (income_in_thousands<50000),,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh,coef_middle_to_low_income_hh +util_mid_to_high_income_hh,Mid to High Income HH,(income_in_thousands>=50000) & (income_in_thousands<100000),,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh,coef_mid_to_high_income_hh +util_high_income_hh,High Income HH,(income_in_thousands>=100000),,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh,coef_high_income_hh +util_number_of_hh_persons,Number of HH Persons,hhsize,,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons,coef_number_of_hh_persons +util_number_of_full_time_workers_in_hh,Number of full time workers in HH,num_full,,,,,,,,,,,,,,,, +util_number_of_students_in_hh,Number of Students in HH,num_student,,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh,coef_number_of_students_in_hh +util_num_kids_between_0_and_4_including_years_old,Num Kids between 0 and 4 (including) years old,num_age_0_4,,,,,,,,,,,,,,,, +util_presence_of_kids_between_0_and_4_including_years_old,Presence of Kids between 0 and 4 (including) years old,(num_age_0_4 > 0),,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old,coef_presence_of_kids_between_0_and_4_including_years_old +util_num_kids_between_5_and_15_including_years_old,Num kids between 5 and 15 (including) years old,num_age_5_15,,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old,coef_num_kids_between_5_and_15_including_years_old +util_presence_of_kids_between_5_and_15_including_years_old,Presence of kids between 5 and 15 (including) years old,(num_age_5_15 > 0),,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old,coef_presence_of_kids_between_5_and_15_including_years_old +util_number_of_adults_16_years_old_,Number of Adults (>= 16 years old),num_adult,,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_,coef_number_of_adults_16_years_old_ +util_dummy_for_single_parent_household,Dummy for single parent household,(num_adult == 1) & (num_age_0_4 + num_age_5_15 > 0),,,,,,,,,,,,,,,, +util_number_of_cars_number_of_workers,Number of Cars > Number of Workers,more_cars_than_workers,,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers,coef_number_of_cars_number_of_workers +util_number_of_vehicles,Number of Vehicles,auto_ownership,,,,,,,,,,,,,,,, +util_dummy_for_female,Dummy for female,female,,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female,coef_dummy_for_female +util_dummy_for_all_stops_made_by_transit,Dummy for all stops made by transit,tour_mode_is_transit,,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit,coef_dummy_for_all_stops_made_by_transit +util_dummy_for_walking_to_all_stops,Dummy for walking to all stops,tour_mode_is_non_motorized,,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops,coef_dummy_for_walking_to_all_stops +util_number_of_work_tours_undertaken_by_the_person,Number of work tours undertaken by the person,num_work_tours,,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person,coef_number_of_work_tours_undertaken_by_the_person +util_number_of_university_tours_tours_undertaken_by_the_person,Number of university tours tours undertaken by the person,num_univ_tours,,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person,coef_number_of_university_tours_tours_undertaken_by_the_person +util_number_of_school_tours_tours_undertaken_by_the_person,Number of school tours tours undertaken by the person,num_school_tours,,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person,coef_number_of_school_tours_tours_undertaken_by_the_person +util_number_of_escort_tours_tours_undertaken_by_the_person,Number of escort tours tours undertaken by the person,num_escort_tours,,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person,coef_number_of_escort_tours_tours_undertaken_by_the_person +util_number_of_shop_tours_undertaken_by_the_person,Number of shop tours undertaken by the person,num_shop_tours,,,,,,,,,,,,,,,, +util_number_of_maintenace_tours_tours_undertaken_by_the_person,Number of maintenace tours tours undertaken by the person,num_maint_tours,,,,,,,,,,,,,,,, +util_number_of_eating_tours_tours_undertaken_by_the_person,Number of eating tours tours undertaken by the person,num_eatout_tours,,,,,,,,,,,,,,,, +util_number_of_visit_tours_tours_undertaken_by_the_person,Number of visit tours tours undertaken by the person,num_social_tours,,,,,,,,,,,,,,,, +util_number_of_shop_tours_undertaken_by_the_houshold,Number of shop tours undertaken by the houshold,num_hh_shop_tours,,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold,coef_number_of_shop_tours_undertaken_by_the_houshold +util_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,AM Peak departure between 6AM and 7 AM (including) Interacted with outbound tours,(start>5) & (start<8),,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours,coef_am_peak_departure_between_6am_and_7_am_including_interacted_with_outbound_tours +util_arrival_later_than_17_00_,Arrival later than 17:00.,(end > 16),,,,,,,,,,,,,,,, +util_evening_arrival_19_00_interacted_with_return_tours,Evening Arrival (>=19:00) Interacted with return tours,(end > 18),,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours,coef_evening_arrival_19_00_interacted_with_return_tours +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,Dummy for the duration of the tour being equal or greater than or equal to 11 hours,(duration > 10),,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours,coef_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_11_hours +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_9_hours_,Dummy for the duration of the tour being equal or greater than or equal to 9 hours ,(duration > 8),,,,,,,,,,,,,,,, +util_dummy_for_the_duration_of_the_tour_being_equal_or_greater_than_or_equal_to_3_hours_,Dummy for the duration of the tour being equal or greater than or equal to 3 hours ,(duration > 2),,,,,,,,,,,,,,,, +util_hh_accesibility_for_outbound_tours_interaction,HH accesibility for outbound tours. Interaction,hhacc,,,,,,,,,,,,,,,, +util_hh_accesibility_for_inbound_tours_interaction,HH accesibility for inbound tours. Interaction,hhacc,,,,,,,,,,,,,,,, +util_primary_destination_accessibility_for_outbound_tours_interaction,Primary Destination Accessibility for outbound tours. Interaction,pracc,,,,,,,,,,,,,,,, +util_primary_destination_accessibility_for_return_tours_interaction,Primary Destination Accessibility for return tours. Interaction,pracc,,,,,,,,,,,,,,,, +util_dummy_for_distance_less_than_20_miles,dummy for distance less than 20 Miles,(distance_in_miles < 20),,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles,coef_dummy_for_distance_less_than_20_miles +util_dummy_for_distance_in_miles,dummy for distance in miles,distance_in_miles,,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles,coef_dummy_for_distance_in_miles +util_no_stops_if_tour_mode_is_drivetransit,No stops if tour mode is driveTransit,tour_mode_is_drive_transit,,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit,coef_no_stops_if_tour_mode_is_drivetransit +util_alternative_specific_constant_for_outbound_stops,Alternative specific constant for outbound stops,1,,,,,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_1out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_2out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in,coef_alternative_specific_constant_for_outbound_stops_3out_0in +util_alternative_specific_constant_for_return_stops,Alternative specific constant for return stops,1,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in,,coef_alternative_specific_constant_for_return_stops_0out_1in,coef_alternative_specific_constant_for_return_stops_0out_2in,coef_alternative_specific_constant_for_return_stops_0out_3in +util_alternative_specific_constant_for_the_total_number_of_stops,Alternative specific constant for the total number of stops,1,,,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_0out_2in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in,coef_alternative_specific_constant_for_the_total_number_of_stops_2out_3in +util_number_of_subtours_in_the_tour,Number of subtours in the tour,num_atwork_subtours,,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour,coef_number_of_subtours_in_the_tour +# No stops for half tour that includes school escorting,,,,,,,,,,,,,,,,,, +util_no_stops_to_school_escorting,Do not allow stops for school escort half-tour -- outbound,"(school_esc_outbound.isin(['ride_share', 'pure_escort']))",,,,,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail,coef_unavail +util_no_stops_from_school_escorting,Do not allow stops for school escort half-tour -- inbound,"(school_esc_inbound.isin(['ride_share', 'pure_escort']))",,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail,,coef_unavail,coef_unavail,coef_unavail diff --git a/activitysim/examples/prototype_mtc_extended/configs/tour_mode_choice.csv b/activitysim/examples/prototype_mtc_extended/configs/tour_mode_choice.csv index 2ba4c6d0df..7679f5731b 100644 --- a/activitysim/examples/prototype_mtc_extended/configs/tour_mode_choice.csv +++ b/activitysim/examples/prototype_mtc_extended/configs/tour_mode_choice.csv @@ -342,3 +342,6 @@ util_Walk_not_available_for_long_distances,Walk not available for long distances 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,,,,,, +#, School Escorting eligibility-odd looking where/isnan is to allow this to work with numba fastmath,,,,,,,,,,,,,,,,,,,,,, +util_one_or_more_school_escort,No SOV if on school escort tour,"@(np.where(np.isnan(df.get('num_escortees', 0)), 0 , df.get('num_escortees', 0)) >= 1)",-999,-999,,,,,,,,,,,,,,,,,,, +util_two_or_more_school_escort,Can't take HOV2 if taking two children and yourself,"@(np.where(np.isnan(df.get('num_escortees', 0)), 0 , df.get('num_escortees', 0)) >= 2)",,,-999,-999,,,,,,,,,,,,,,,,, diff --git a/activitysim/examples/prototype_mtc_extended/configs/tour_scheduling_nonmandatory.csv b/activitysim/examples/prototype_mtc_extended/configs/tour_scheduling_nonmandatory.csv new file mode 100644 index 0000000000..19ef4dfc32 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/tour_scheduling_nonmandatory.csv @@ -0,0 +1,100 @@ +Label,Description,Expression,Coefficient +util_subsequent_tour_must_start_after_previous_tour_for_this_purpose_ends,Subsequent tour must start after previous tour for this purpose ends,(start < end_previous) & (tour_type_num > 1),coef_subsequent_tour_must_start_after_previous_tour_for_this_purpose_ends +util_free_flow_round_trip_auto_time_shift_effects_duration,Free-flow round trip auto time shift effects - duration,roundtrip_auto_time_to_work * duration,coef_free_flow_round_trip_auto_time_shift_effects_duration +util_shopping_tour_departure_shift_effects,Shopping tour - departure shift effects,(tour_type == 'shopping') * start,coef_shopping_tour_departure_shift_effects +util_shopping_tour_duration_shift_effects,Shopping tour - duration shift effects,(tour_type == 'shopping') * duration,coef_shopping_tour_duration_shift_effects +util_maintenance_tour_departure_shift_effects,Maintenance tour - departure shift effects,(tour_type == 'othmaint') * start,coef_maintenance_tour_departure_shift_effects +util_maintenance_tour_duration_shift_effects,Maintenance tour - departure shift effects,(tour_type == 'othmaint') * duration,coef_maintenance_tour_duration_shift_effects +util_visit_tour_departure_shift_effects_start,Visit tour - departure shift effects,(tour_type == 'social') * start,coef_visit_tour_departure_shift_effects +util_visit_tour_duration_shift_effects_duration,Visit tour - departure shift effects,(tour_type == 'social') * duration,coef_visit_tour_duration_shift_effects +util_eat_out_tour_departure_shift_effects,Eat Out tour - departure shift effects,(tour_type == 'eatout') * start,coef_eat_out_tour_departure_shift_effects +util_school_child_age_16_plus_departure_shift_effects,School child age 16+ - departure shift effects,(ptype == 6) * start,coef_school_child_age_16_plus_departure_shift_effects +util_school_child_age_16_plus_duration_shift_effects,School child age 16+ - duration shift effects,(ptype == 6) * duration,coef_school_child_age_16_plus_duration_shift_effects +util_school_child_age_under_16_departure_shift_effects,School child age under 16 - departure shift effects,(ptype == 7) * start,coef_school_child_age_under_16_departure_shift_effects +util_school_child_age_under_16_duration_shift_effects,School child age under 16 - duration shift effects,(ptype == 7) * duration,coef_school_child_age_under_16_duration_shift_effects +util_destination_in_cbd_duration_shift_effects,Destination in CBD - duration shift effects,destination_in_cbd * duration,coef_destination_in_cbd_duration_shift_effects +util_number_of_mandatory_tours_departure_shift_effects,Number of mandatory tours - departure shift effects,num_mand * start,coef_number_of_mandatory_tours_departure_shift_effects +util_number_of_joint_tours_departure_shift_effects,Number of joint tours - departure shift effects,num_person_joint_tours * start,coef_number_of_joint_tours_departure_shift_effects +util_number_of_escort_tours_departure_shift_effects,Number of escort tours - departure shift effects,num_escort_tours * start,coef_number_of_escort_tours_departure_shift_effects +util_number_of_individual_non_mandatory_tours_excluding_escort_departure_shift_effects,Number of idividual non-mandatory tours (excluding escort) - departure shift effects,num_non_escort_tours * start,coef_number_of_individual_non_mandatory_tours_excluding_escort_departure_shift_effects +util_first_of_2_plus_tours_for_same_purpose_departure_shift_effect,First of 2+ tours for same purpose - departure shift effect,((tour_type_count>1) & (tour_type_num == 1)) * start,coef_first_of_2_plus_tours_for_same_purpose_departure_shift_effect +util_subsequent_of_2_plus_tours_for_same_purpose_duration_shift_effect,subsequent of 2+ tours for same purpose - duration shift effect,(tour_type_num > 1) * duration,coef_subsequent_of_2_plus_tours_for_same_purpose_duration_shift_effect +util_maintenance_tour_depart_before_7,Maintenance tour - depart before 7,(tour_type == 'othmaint') & (start < 7),coef_maintenance_tour_depart_before_7 +util_shopping_tour_depart_before_8,Shopping tour - depart before 8,(tour_type == 'shopping') & (start < 8),coef_shopping_tour_depart_before_8 +util_shopping_tour_arrive_after_22,Shopping tour - arrive after 22,(tour_type == 'shopping') & (end > 22),coef_shopping_tour_arrive_after_22 +util_school_child_under_16_arrive_after_22,School child under 16 - arrive after 22,(ptype == 7) & (end > 22),coef_school_child_under_16_arrive_after_22 +util_university_student_arrive_after_22,University student - arrive after 22,(ptype == 3) & (end > 22),coef_university_student_arrive_after_22 +util_shopping_tour_duration_lt_2_hours,Shopping tour - duration < 2 hours,(tour_type == 'shopping') & (duration < 2),coef_shopping_tour_duration_lt_2_hours +util_discretionary_tour_duration_lt_2_hours,Discretionary tour - duration < 2 hours,(tour_type == 'othdiscr') & (duration < 2),coef_discretionary_tour_duration_lt_2_hours +util_adult_with_children_in_hh_arrive_19_21,Adult with children in HH - arrive 19 - 21,adult & (num_children > 0) & ( end > 18 ) & ( end < 22 ),coef_adult_with_children_in_hh_arrive_19_21 +#,,, +#,Mode Choice Logsum,mode_choice_logsum,#mode_choice_logsum +#,,,# +util_dummy_adjacent_before,,"_adjacent_window_before@tt.adjacent_window_before(df.person_id, df.start)",coef_dummy +util_dummy_adjacent_after,,"_adjacent_window_after@tt.adjacent_window_after(df.person_id, df.end)",coef_dummy +util_some_previously_scheduled_tour_ends_in_this_departure_hour,Some previously-scheduled tour ends in this departure hour,"@tt.previous_tour_ends(df.person_id, df.start)",coef_some_previously_scheduled_tour_ends_in_this_departure_hour +util_some_previously_scheduled_tour_begins_in_this_arrival_hour,Some previously-scheduled tour begins in this arrival hour,"@tt.previous_tour_begins(df.person_id, df.end)",coef_some_previously_scheduled_tour_begins_in_this_arrival_hour +util_adjacent_window_exists_before_this_departure_hour_first_tour_interaction,Adjacent window exists before this departure hour - first tour interaction,"@(df.tour_type_count>1) & (df.tour_type_num == 1) & (_adjacent_window_before!=0)",coef_adjacent_window_exists_before_this_departure_hour_first_tour_interaction +util_adjacent_window_exists_after_this_arrival_hour_first_tour_interaction,Adjacent window exists after this arrival hour - first tour interaction,"@(df.tour_type_count>1) & (df.tour_type_num == 1) & (_adjacent_window_after!=0)",coef_adjacent_window_exists_after_this_arrival_hour_first_tour_interaction +util_adjacent_window_exists_before_this_departure_hour_second_plus_tour_interaction,Adjacent window exists before this departure hour - second+ tour interaction,"@(df.tour_type_num > 1) & (_adjacent_window_before!=0)",coef_adjacent_window_exists_before_this_departure_hour_second_plus_tour_interaction +util_adjacent_window_exists_after_this_arrival_hour_second_plus_tour_interaction,Adjacent window exists after this arrival hour - second+ tour interaction,"@(df.tour_type_num > 1) & (_adjacent_window_after!=0)",coef_adjacent_window_exists_after_this_arrival_hour_second_plus_tour_interaction +util_ratio_of_individual_non_mandatory_tours_to_be_scheduled_to_number_of_unscheduled_hours,Remaining individual non-mandatory tours to be scheduled / number of unscheduled hours,"@((1.0 + df.tour_count - df.tour_num)) / tt.remaining_periods_available(df.person_id, df.start, df.end)",coef_ratio_of_individual_non_mandatory_tours_to_be_scheduled_to_number_of_unscheduled_hours +#,#,,# +util_departure_constants_early,Departure Constants -- Early (up to 5),(tour_type != 'escort') & (start < 6),coef_departure_constants_early +util_departure_constants_am_peak_1,Departure Constants -- AM peak 1 (6),(tour_type != 'escort') & (start == 6),coef_departure_constants_am_peak_1 +util_departure_constants_am_peak_2,Departure Constants -- AM peak 2 (7),(tour_type != 'escort') & (start == 7),coef_departure_constants_am_peak_2 +util_departure_constants_am_peak_3,Departure Constants -- AM peak 3 (8),(tour_type != 'escort') & (start == 8),coef_departure_constants_am_peak_3 +util_departure_constants_am_peak_4,Departure Constants -- AM peak 4 (9),(tour_type != 'escort') & (start == 9),coef_departure_constants_am_peak_4 +util_departure_constants_midday_1,Departure Constants -- Midday 1 (10 to 12),(tour_type != 'escort') & (start > 9) & (start < 13),coef_departure_constants_midday_1 +util_departure_constants_midday_2,Departure Constants -- Midday 2 (13 to 15),(tour_type != 'escort') & (start > 12) & (start < 16),coef_departure_constants_midday_2 +util_departure_constants_pm_peak,Departure Constants -- PM peak (16 to 18),(tour_type != 'escort') & (start > 15) & (start < 19),coef_departure_constants_pm_peak +util_departure_constants_evening,Departure Constants -- Evening (19 to 21),(tour_type != 'escort') & (start > 18) & (start < 22),coef_departure_constants_evening +util_departure_constants_late,Departure Constants -- Late (22 and later),(tour_type != 'escort') & (start > 21),coef_departure_constants_late +util_arrival_constants_early,Arrival Constants -- Early (up to 6),(tour_type != 'escort') & (end < 7),coef_arrival_constants_early +util_arrival_constants_am_peak,Arrival Constants -- AM peak (7 to 9),(tour_type != 'escort') & (end > 6) & (end < 10),coef_arrival_constants_am_peak +util_arrival_constants_midday_1,Arrival Constants -- Midday 1 (10 to 12),(tour_type != 'escort') & (end > 9) & (end < 13),coef_arrival_constants_midday_1 +util_arrival_constants_midday_2,Arrival Constants -- Midday 2 (13 to 14),(tour_type != 'escort') & (end > 12) & (end < 15),coef_arrival_constants_midday_2 +util_arrival_constants_pm_peak_1,Arrival Constants -- PM peak 1 (15),(tour_type != 'escort') & (end == 15),coef_arrival_constants_pm_peak_1 +util_arrival_constants_pm_peak_2,Arrival Constants -- PM peak 2 (16),(tour_type != 'escort') & (end == 16),coef_arrival_constants_pm_peak_2 +util_arrival_constants_pm_peak_3,Arrival Constants -- PM peak 3 (17),(tour_type != 'escort') & (end == 17),coef_arrival_constants_pm_peak_3 +util_arrival_constants_pm_peak_4,Arrival Constants -- PM peak 4 (18),(tour_type != 'escort') & (end == 18),coef_arrival_constants_pm_peak_4 +util_arrival_constants_evening,Arrival Constants -- Evening (19 to 21),(tour_type != 'escort') & (end > 18) & (end < 22),coef_arrival_constants_evening +util_arrival_constants_late,Arrival Constants -- Late (22 and later),(tour_type != 'escort') & (end > 21),coef_arrival_constants_late +util_duration_constants_0_to_1_hours,Duration Constants -- 0 to 1 hours,(tour_type != 'escort') & (duration < 2),coef_duration_constants_0_to_1_hours +util_duration_constants_2_to_3_hours,Duration Constants -- 2 to 3 hours,(tour_type != 'escort') & (duration > 1) & (duration < 4),coef_duration_constants_2_to_3_hours +util_duration_constants_4_to_5_hours,Duration Constants -- 4 to 5 hours,(tour_type != 'escort') & (duration > 3) & (duration < 6),coef_duration_constants_4_to_5_hours +util_duration_constants_6_to_7_hours,Duration Constants -- 6 to 7 hours,(tour_type != 'escort') & (duration > 5) & (duration < 8),coef_duration_constants_6_to_7_hours +util_duration_constants_8_to_10_hours,Duration Constants -- 8 to 10 hours,(tour_type != 'escort') & (duration > 7) & (duration < 11),coef_duration_constants_8_to_10_hours +util_duration_constants_11_to_13_hours,Duration Constants -- 11 to 13 hours,(tour_type != 'escort') & (duration > 10) & (duration < 14),coef_duration_constants_11_to_13_hours +util_duration_constants_14_to_18_hours,Duration Constants -- 14 to 18 hours,(tour_type != 'escort') & (duration > 13) & (duration < 19),coef_duration_constants_14_to_18_hours +util_escort_tour_departure_constants_early,Escort Tour Departure Constants -- Early (up to 5),(tour_type == 'escort') & (start < 6),coef_escort_tour_departure_constants_early +util_escort_tour_departure_constants_am_peak_1,Escort Tour Departure Constants -- AM peak 1 (6),(tour_type == 'escort') & (start == 6),coef_escort_tour_departure_constants_am_peak_1 +util_escort_tour_departure_constants_am_peak_2,Escort Tour Departure Constants -- AM peak 2 (7),(tour_type == 'escort') & (start == 7),coef_escort_tour_departure_constants_am_peak_2 +util_escort_tour_departure_constants_am_peak_3,Escort Tour Departure Constants -- AM peak 3 (8),(tour_type == 'escort') & (start == 8),coef_escort_tour_departure_constants_am_peak_3 +util_escort_tour_departure_constants_am_peak_4,Escort Tour Departure Constants -- AM peak 4 (9),(tour_type == 'escort') & (start == 9),coef_escort_tour_departure_constants_am_peak_4 +util_escort_tour_departure_constants_midday_1,Escort Tour Departure Constants -- Midday 1 (10 to 12),(tour_type == 'escort') & (start > 9) & (start < 13),coef_escort_tour_departure_constants_midday_1 +util_escort_tour_departure_constants_midday_2,Escort Tour Departure Constants -- Midday 2 (13 to 15),(tour_type == 'escort') & (start > 12) & (start < 16),coef_escort_tour_departure_constants_midday_2 +util_escort_tour_departure_constants_pm_peak,Escort Tour Departure Constants -- PM peak (16 to 18),(tour_type == 'escort') & (start > 15) & (start < 19),coef_escort_tour_departure_constants_pm_peak +util_escort_tour_departure_constants_evening,Escort Tour Departure Constants -- Evening (19 to 21),(tour_type == 'escort') & (start > 18) & (start < 22),coef_escort_tour_departure_constants_evening +util_escort_tour_departure_constants_late,Escort Tour Departure Constants -- Late (22 and later),(tour_type == 'escort') & (start > 21),coef_escort_tour_departure_constants_late +util_escort_tour_arrival_constants_early,Escort Tour Arrival Constants -- Early (up to 6),(tour_type == 'escort') & (end < 7),coef_escort_tour_arrival_constants_early +util_escort_tour_arrival_constants_am_peak,Escort Tour Arrival Constants -- AM peak (7 to 9),(tour_type == 'escort') & (end > 6) & (end < 10),coef_escort_tour_arrival_constants_am_peak +util_escort_tour_arrival_constants_midday_1,Escort Tour Arrival Constants -- Midday 1 (10 to 12),(tour_type == 'escort') & (end > 9) & (end < 13),coef_escort_tour_arrival_constants_midday_1 +util_escort_tour_arrival_constants_midday_2,Escort Tour Arrival Constants -- Midday 2 (13 to 14),(tour_type == 'escort') & (end > 12) & (end < 15),coef_escort_tour_arrival_constants_midday_2 +util_escort_tour_arrival_constants_pm_peak_1,Escort Tour Arrival Constants -- PM peak 1 (15),(tour_type == 'escort') & (end == 15),coef_escort_tour_arrival_constants_pm_peak_1 +util_escort_tour_arrival_constants_pm_peak_2,Escort Tour Arrival Constants -- PM peak 2 (16),(tour_type == 'escort') & (end == 16),coef_escort_tour_arrival_constants_pm_peak_2 +util_escort_tour_arrival_constants_pm_peak_3,Escort Tour Arrival Constants -- PM peak 3 (17),(tour_type == 'escort') & (end == 17),coef_escort_tour_arrival_constants_pm_peak_3 +util_escort_tour_arrival_constants_pm_peak_4,Escort Tour Arrival Constants -- PM peak 4 (18),(tour_type == 'escort') & (end == 18),coef_escort_tour_arrival_constants_pm_peak_4 +util_escort_tour_arrival_constants_evening,Escort Tour Arrival Constants -- Evening (19 to 21),(tour_type == 'escort') & (end > 18) & (end < 22),coef_escort_tour_arrival_constants_evening +util_escort_tour_arrival_constants_late,Escort Tour Arrival Constants -- Late (22 and later),(tour_type == 'escort') & (end > 21),coef_escort_tour_arrival_constants_late +util_escort_tour_duration_constants_0_to_1_hours,Escort Tour Duration Constants -- 0 to 1 hours,(tour_type == 'escort') & (duration < 2),coef_escort_tour_duration_constants_0_to_1_hours +util_escort_tour_duration_constants_2_to_3_hours,Escort Tour Duration Constants -- 2 to 3 hours,(tour_type == 'escort') & (duration > 1) & (duration < 4),coef_escort_tour_duration_constants_2_to_3_hours +util_escort_tour_duration_constants_4_to_5_hours,Escort Tour Duration Constants -- 4 to 5 hours,(tour_type == 'escort') & (duration > 3) & (duration < 6),coef_escort_tour_duration_constants_4_to_5_hours +util_escort_tour_duration_constants_6_to_7_hours,Escort Tour Duration Constants -- 6 to 7 hours,(tour_type == 'escort') & (duration > 5) & (duration < 8),coef_escort_tour_duration_constants_6_to_7_hours +util_escort_tour_duration_constants_8_to_10_hours,Escort Tour Duration Constants -- 8 to 10 hours,(tour_type == 'escort') & (duration > 7) & (duration < 11),coef_escort_tour_duration_constants_8_to_10_hours +util_escort_tour_duration_constants_11_to_13_hours,Escort Tour Duration Constants -- 11 to 13 hours,(tour_type == 'escort') & (duration > 10) & (duration < 14),coef_escort_tour_duration_constants_11_to_13_hours +util_escort_tour_duration_constants_14_to_18_hours,Escort Tour Duration Constants -- 14 to 18 hours,(tour_type == 'escort') & (duration > 13) & (duration < 19),coef_escort_tour_duration_constants_14_to_18_hours +# Including terms for school escorting,,, +util_outbound_school_escort_tour_start,Outbound school escort tours must match the start time of the escort tour,is_outbound_school_escort_tour & (start != school_escort_tour_start),coef_unavailable +util_outbound_school_escort_tour_next_start,Outbound school escort tours must end before next escort tour start,is_outbound_school_escort_tour & (end > school_escort_tour_next_start) & (school_escort_tour_next_start > 0),coef_unavailable +util_inbound_school_escort_tour_end,Inbound school escort tours must match the end time of the escort tour,is_inbound_school_escort_tour & (end != school_escort_tour_end),coef_unavailable diff --git a/activitysim/examples/prototype_mtc_extended/configs/tour_scheduling_nonmandatory_coefficients.csv b/activitysim/examples/prototype_mtc_extended/configs/tour_scheduling_nonmandatory_coefficients.csv new file mode 100644 index 0000000000..bbb01bb05e --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/tour_scheduling_nonmandatory_coefficients.csv @@ -0,0 +1,97 @@ +coefficient_name,value,constrain +coef_dummy,1,T +coef_subsequent_tour_must_start_after_previous_tour_for_this_purpose_ends,-999,T +coef_free_flow_round_trip_auto_time_shift_effects_duration,0.004741,F +coef_shopping_tour_departure_shift_effects,-0.06015,F +coef_shopping_tour_duration_shift_effects,-0.1208,F +coef_maintenance_tour_departure_shift_effects,-0.1489,F +coef_maintenance_tour_duration_shift_effects,-0.08372,F +coef_visit_tour_departure_shift_effects,0.09688,F +coef_visit_tour_duration_shift_effects,0.1638,F +coef_eat_out_tour_departure_shift_effects,0.07549,F +coef_school_child_age_16_plus_departure_shift_effects,0.07266,F +coef_school_child_age_16_plus_duration_shift_effects,0.2095,F +coef_school_child_age_under_16_departure_shift_effects,0.04657,F +coef_school_child_age_under_16_duration_shift_effects,0.3272,F +coef_destination_in_cbd_duration_shift_effects,0.1067,F +coef_number_of_mandatory_tours_departure_shift_effects,0.04673,F +coef_number_of_joint_tours_departure_shift_effects,0.05208,F +coef_number_of_escort_tours_departure_shift_effects,0.02013,F +coef_number_of_individual_non_mandatory_tours_excluding_escort_departure_shift_effects,0.03896,F +coef_first_of_2_plus_tours_for_same_purpose_departure_shift_effect,-0.2364,F +coef_subsequent_of_2_plus_tours_for_same_purpose_duration_shift_effect,-0.1731,F +coef_maintenance_tour_depart_before_7,-0.8826,F +coef_shopping_tour_depart_before_8,-1.037,F +coef_shopping_tour_arrive_after_22,-0.6027,F +coef_school_child_under_16_arrive_after_22,-1.18,F +coef_university_student_arrive_after_22,0.5466,F +coef_shopping_tour_duration_lt_2_hours,0.5168,F +coef_discretionary_tour_duration_lt_2_hours,-0.6974,F +coef_adult_with_children_in_hh_arrive_19_21,0.336,F +#,, +#mode_choice_logsum,, +#,, +coef_some_previously_scheduled_tour_ends_in_this_departure_hour,-0.4562,F +coef_some_previously_scheduled_tour_begins_in_this_arrival_hour,-0.3992,F +coef_adjacent_window_exists_before_this_departure_hour_first_tour_interaction,0.008442,F +coef_adjacent_window_exists_after_this_arrival_hour_first_tour_interaction,-0.0257,F +coef_adjacent_window_exists_before_this_departure_hour_second_plus_tour_interaction,-0.0593,F +coef_adjacent_window_exists_after_this_arrival_hour_second_plus_tour_interaction,-0.02734,F +coef_ratio_of_individual_non_mandatory_tours_to_be_scheduled_to_number_of_unscheduled_hours,-13.63,F +#,,F +coef_departure_constants_early,-1.740135661,F +coef_departure_constants_am_peak_1,-0.654163573,F +coef_departure_constants_am_peak_2,0.554282571,F +coef_departure_constants_am_peak_3,1.050561087,F +coef_departure_constants_am_peak_4,0.971568228,F +coef_departure_constants_midday_1,0.881991986,F +coef_departure_constants_midday_2,0.411103634,F +coef_departure_constants_pm_peak,0,T +coef_departure_constants_evening,-1.856475096,F +coef_departure_constants_late,-8.228880141,F +coef_arrival_constants_early,-0.051990748,F +coef_arrival_constants_am_peak,-1.814822602,F +coef_arrival_constants_midday_1,0.000371501,F +coef_arrival_constants_midday_2,0.532116031,F +coef_arrival_constants_pm_peak_1,0.628481567,F +coef_arrival_constants_pm_peak_2,0.650521416,F +coef_arrival_constants_pm_peak_3,0.402894406,F +coef_arrival_constants_pm_peak_4,0.154213293,F +coef_arrival_constants_evening,0,T +coef_arrival_constants_late,-0.866671315,F +coef_duration_constants_0_to_1_hours,0,T +coef_duration_constants_2_to_3_hours,0.051385565,F +coef_duration_constants_4_to_5_hours,-0.593951321,F +coef_duration_constants_6_to_7_hours,-0.951155328,F +coef_duration_constants_8_to_10_hours,-0.828108399,F +coef_duration_constants_11_to_13_hours,-0.955635554,F +coef_duration_constants_14_to_18_hours,-1.042580879,F +coef_escort_tour_departure_constants_early,-1.740135661,F +coef_escort_tour_departure_constants_am_peak_1,-1.112357753,F +coef_escort_tour_departure_constants_am_peak_2,0.698788185,F +coef_escort_tour_departure_constants_am_peak_3,1.196268813,F +coef_escort_tour_departure_constants_am_peak_4,-0.225258221,F +coef_escort_tour_departure_constants_midday_1,0.028662017,F +coef_escort_tour_departure_constants_midday_2,0,T +coef_escort_tour_departure_constants_pm_peak,-1.180140161,F +coef_escort_tour_departure_constants_evening,-3.948732811,F +coef_escort_tour_departure_constants_late,-8.228880141,F +coef_escort_tour_arrival_constants_early,0,T +coef_escort_tour_arrival_constants_am_peak,0,T +coef_escort_tour_arrival_constants_midday_1,0,T +coef_escort_tour_arrival_constants_midday_2,0,T +coef_escort_tour_arrival_constants_pm_peak_1,0,T +coef_escort_tour_arrival_constants_pm_peak_2,0,T +coef_escort_tour_arrival_constants_pm_peak_3,0,T +coef_escort_tour_arrival_constants_pm_peak_4,0,T +coef_escort_tour_arrival_constants_evening,-0.536918728,F +coef_escort_tour_arrival_constants_late,-1.008290213,F +coef_escort_tour_duration_constants_0_to_1_hours,0,T +coef_escort_tour_duration_constants_2_to_3_hours,-2.042013897,F +coef_escort_tour_duration_constants_4_to_5_hours,-2.880293896,F +coef_escort_tour_duration_constants_6_to_7_hours,-2.973533731,F +coef_escort_tour_duration_constants_8_to_10_hours,-3.020213758,F +coef_escort_tour_duration_constants_11_to_13_hours,-2.974364976,F +coef_escort_tour_duration_constants_14_to_18_hours,-2.507447146,F +# Added for school escorting,, +coef_unavailable,-999,F \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice.csv b/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice.csv index 0253954dbb..e9318c206c 100644 --- a/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice.csv +++ b/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice.csv @@ -403,3 +403,6 @@ util_Bike_not_available_for_long_distances,Bike not available for long distances 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 +#, School Escorting eligibility,,,,,,,,,,,,,,,,,,,,,, +util_one_or_more_school_escort,No SOV if on school escort tour,(num_escortees >= 1),-999,-999,,,,,,,,,,,,,,,,,,, +util_two_or_more_school_escort,Can't take HOV2 if taking two children and yourself,(num_escortees >= 2),,,-999,-999,,,,,,,,,,,,,,,,, \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice.yaml b/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice.yaml index 7127618637..93658ea044 100644 --- a/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice.yaml +++ b/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice.yaml @@ -186,10 +186,11 @@ preprocessor: - tours - vehicles -# - SPEC: trip_mode_choice_annotate_trips_preprocessor2 -# DF: df -# TABLES: -# - land_use +# annotate_trips: +# SPEC: trip_mode_choice_annotate_trips_postprocessor +# DF: df +# TABLES: +# - tours # to reduce memory needs filter chooser table to these fields TOURS_MERGED_CHOOSER_COLUMNS: diff --git a/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice_annotate_trips_preprocessor.csv b/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice_annotate_trips_preprocessor.csv index cc1f223d57..fefe54a13d 100644 --- a/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice_annotate_trips_preprocessor.csv +++ b/activitysim/examples/prototype_mtc_extended/configs/trip_mode_choice_annotate_trips_preprocessor.csv @@ -91,3 +91,5 @@ dest terminal time not counted at home,_dest_terminal_time,"np.where(inbound & l #,max_dist_walk,od_skims.max('DISTWALK') #,dist_bike,od_skims['DISTBIKE'] #,dist_only,od_skims['DIST'] +# added for school escorting model,, +Number of school children in vehicle on trip,num_escortees,df.escort_participants.fillna('').apply(lambda x: len(x.split('_'))) \ No newline at end of file diff --git a/activitysim/examples/prototype_mtc_extended/configs/trip_scheduling.yaml b/activitysim/examples/prototype_mtc_extended/configs/trip_scheduling.yaml new file mode 100644 index 0000000000..53b07924c3 --- /dev/null +++ b/activitysim/examples/prototype_mtc_extended/configs/trip_scheduling.yaml @@ -0,0 +1,11 @@ +PROBS_SPEC: trip_scheduling_probs.csv +COEFFICIENTS: trip_scheduling_coefficients.csv + +# int to add to probs column index to get time period it represents. +# e.g. depart_alt_base = 5 means first column (column 0) represents 5 am +DEPART_ALT_BASE: 5 + +MAX_ITERATIONS: 100 + +# FAILFIX: drop_and_cleanup +FAILFIX: choose_most_initial diff --git a/activitysim/examples/prototype_mtc_extended/configs_mp/settings.yaml b/activitysim/examples/prototype_mtc_extended/configs_mp/settings.yaml index 0e6aa415e4..f5453072e8 100644 --- a/activitysim/examples/prototype_mtc_extended/configs_mp/settings.yaml +++ b/activitysim/examples/prototype_mtc_extended/configs_mp/settings.yaml @@ -56,6 +56,7 @@ models: - cdap_simulate - mandatory_tour_frequency - mandatory_tour_scheduling + - school_escorting - joint_tour_frequency - joint_tour_composition - joint_tour_participation diff --git a/activitysim/examples/prototype_mtc_extended/test/regress/final_trips.csv b/activitysim/examples/prototype_mtc_extended/test/regress/final_trips.csv index 3ad3509441..77903c4f3c 100644 --- a/activitysim/examples/prototype_mtc_extended/test/regress/final_trips.csv +++ b/activitysim/examples/prototype_mtc_extended/test/regress/final_trips.csv @@ -1,68 +1,91 @@ -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 -270680011,644476,386761,escort,1,True,1,16,16,27068001,escort,,5,WALK,0.5320114470722612 -270680016,644476,386761,escort,1,False,1,16,16,27068001,home,,5,TNC_SHARED,0.5320114470722612 -270680321,644476,386761,work,1,True,1,5,16,27068032,work,,5,WALK,3.784483617465789 -270680326,644476,386761,work,1,False,2,25,5,27068032,escort,36.837865536411556,17,WALK_LOC,3.8263633311364242 -270680327,644476,386761,work,2,False,2,16,25,27068032,home,,19,WALK,10.360438250702908 -270680681,644477,386761,shopping,1,True,1,5,16,27068068,shopping,,10,WALK,4.08926155146542 -270680686,644477,386761,shopping,1,False,1,16,5,27068068,home,,19,WALK,4.011141788832443 -270681081,644478,386761,school,1,True,1,22,16,27068108,school,,7,WALK,0.4463126906111215 -270681086,644478,386761,school,1,False,1,16,22,27068108,home,,13,WALK,0.6143299273673037 -660517121,1572659,763879,shopping,1,True,2,9,6,66051712,shopping,30.034881810916566,11,WALK_LOC,10.793454218489755 -660517122,1572659,763879,shopping,2,True,2,19,9,66051712,shopping,,12,TNC_SINGLE,0.5947152742072429 -660517126,1572659,763879,shopping,1,False,1,6,19,66051712,home,,20,WALK_LOC,0.40082631615857406 -685854941,1632987,824207,work,1,True,1,2,18,68585494,work,,7,WALK_LOC,0.012358327110380882 -685854946,1632987,824207,work,1,False,1,18,2,68585494,home,,17,WALK_LRF,0.3476878505929388 -787803221,1875721,982875,work,1,True,1,12,16,78780322,work,,8,BIKE,3.3186538058635886 -787803226,1875721,982875,work,1,False,1,16,12,78780322,home,,17,BIKE,3.3186537522718957 -787803301,1875722,982875,eatout,1,True,1,18,16,78780330,eatout,,7,WALK,0.25375271650786135 -787803306,1875722,982875,eatout,1,False,1,16,18,78780330,home,,13,WALK,0.22587009469786754 -906804341,2159057,1099626,work,1,True,1,2,20,90680434,work,,6,WALK,-0.31801945845680446 -906804346,2159057,1099626,work,1,False,1,20,2,90680434,home,,16,DRIVEALONEFREE,-2.1064263496483453 -906804681,2159058,1099626,univ,1,True,1,9,20,90680468,univ,,17,WALK_LOC,10.081589126967758 -906804686,2159058,1099626,univ,1,False,1,20,9,90680468,home,,20,WALK_LOC,9.95195853064744 -906805101,2159059,1099626,school,1,True,1,20,20,90680510,school,,7,WALK,2.001157626801728 -906805106,2159059,1099626,school,1,False,1,20,20,90680510,home,,15,WALK,2.001157626801728 -1078013561,2566698,1196298,work,1,True,1,1,25,107801356,work,,6,TNC_SINGLE,0.5218384234138416 -1078013566,2566698,1196298,work,1,False,1,25,1,107801356,home,,16,TNC_SINGLE,0.48556944294283877 -1078014321,2566700,1196298,school,1,True,1,24,25,107801432,school,,7,WALK_LOC,2.6558477997467738 -1078014326,2566700,1196298,school,1,False,1,25,24,107801432,home,,9,WALK_LOC,2.5642389027598185 -1078014741,2566701,1196298,school,1,True,1,1,25,107801474,school,,8,WALK_LOC,-0.7798918703154758 -1078014746,2566701,1196298,school,1,False,1,25,1,107801474,home,,16,WALK_LOC,-0.8462395764506365 -1078015161,2566702,1196298,school,1,True,1,2,25,107801516,school,,8,WALK,-0.12577374954461829 -1078015166,2566702,1196298,school,1,False,1,25,2,107801516,home,,13,WALK,-0.3303965444468694 -1285995821,3061894,1363467,shopping,1,True,2,7,24,128599582,othmaint,36.460758096403005,8,WALK,12.852372712730944 -1285995822,3061894,1363467,shopping,2,True,2,19,7,128599582,shopping,,8,DRIVEALONEFREE,0.6685799294322372 -1285995826,3061894,1363467,shopping,1,False,1,24,19,128599582,home,,19,SHARED2FREE,-0.6841449484072673 -1285996191,3061895,1363467,othmaint,1,True,1,4,24,128599619,othmaint,,7,WALK_LOC,0.8657906793525643 -1285996196,3061895,1363467,othmaint,1,False,1,24,4,128599619,home,,15,TNC_SINGLE,0.8645860484799108 -1285996271,3061895,1363467,social,1,True,1,11,24,128599627,social,,16,WALK_LOC,3.2107016897939977 -1285996276,3061895,1363467,social,1,False,1,24,11,128599627,home,,16,WALK_LOC,3.1342659069708274 -1285996301,3061895,1363467,work,1,True,1,2,24,128599630,work,,16,WALK,-0.11170571223054646 -1285996306,3061895,1363467,work,1,False,1,24,2,128599630,home,,22,WALK,-0.0853172208777054 -1752078621,4171615,1810015,univ,1,True,3,8,16,175207862,shopping,35.03505555221861,7,WALK,9.727146483995874 -1752078622,4171615,1810015,univ,2,True,3,7,8,175207862,shopping,41.47430148005939,8,WALK,13.486637386410468 -1752078623,4171615,1810015,univ,3,True,3,5,7,175207862,univ,,8,WALK,4.07498648453161 -1752078626,4171615,1810015,univ,1,False,1,16,5,175207862,home,,13,WALK,3.489626616165674 -1752079011,4171616,1810015,othmaint,1,True,1,19,16,175207901,othmaint,,14,TNC_SHARED,0.0016175329783967448 -1752079016,4171616,1810015,othmaint,1,False,1,16,19,175207901,home,,20,DRIVEALONEFREE,-0.9029931043506836 -1752079181,4171617,1810015,atwork,1,True,1,24,2,175207918,atwork,,14,WALK,3.35042938901452 -1752079186,4171617,1810015,atwork,1,False,1,2,24,175207918,work,,14,WALK,3.327869428854691 -1752079541,4171617,1810015,work,1,True,1,2,16,175207954,work,,9,WALK,-0.3408543940448438 -1752079546,4171617,1810015,work,1,False,1,16,2,175207954,home,,18,WALK,-0.4904505209392121 -1752080321,4171619,1810015,shopping,1,True,1,1,16,175208032,shopping,,14,WALK,-1.0053143437541998 -1752080326,4171619,1810015,shopping,1,False,1,16,1,175208032,home,,15,WALK,-1.1950043076874513 -1752080721,4171620,1810015,school,1,True,1,4,16,175208072,school,,7,WALK,-0.48035583077478106 -1752080726,4171620,1810015,school,1,False,1,16,4,175208072,home,,16,WALK,-0.48035850407554204 -1752081581,4171622,1810015,shopping,1,True,1,16,16,175208158,shopping,,11,WALK,7.3308794494701575 -1752081586,4171622,1810015,shopping,1,False,1,16,16,175208158,home,,15,WALK,7.330879449572421 -1752081701,4171623,1810015,atwork,1,True,1,1,22,175208170,atwork,,12,WALK,-0.6542981934820419 -1752081706,4171623,1810015,atwork,1,False,1,22,1,175208170,work,,13,WALK,-0.9475935966647256 -1752082061,4171623,1810015,work,1,True,1,22,16,175208206,work,,7,WALK,0.362388299138621 -1752082066,4171623,1810015,work,1,False,1,16,22,175208206,home,,22,WALK,0.4987831386861982 -3155256171,7512514,2821179,othmaint,1,True,1,9,8,315525617,othmaint,,12,WALK,6.622033921399732 -3155256176,7512514,2821179,othmaint,1,False,1,8,9,315525617,home,,15,WALK,6.622033921399732 -3155256221,7512514,2821179,shopping,1,True,1,2,8,315525622,shopping,,12,WALK,0.12220973142838766 -3155256226,7512514,2821179,shopping,1,False,1,8,2,315525622,home,,12,BIKE,0.06782315574947502 -3155697701,7513565,2822230,work,1,True,1,2,8,315569770,work,,8,WALK_LOC,0.38883325086589965 -3155697706,7513565,2822230,work,1,False,1,8,2,315569770,home,,21,WALK_LRF,0.741826248790529 +trip_id,person_id,household_id,primary_purpose,trip_num,outbound,trip_count,destination,origin,tour_id,escort_participants,school_escort_direction,purpose,destination_logsum,depart,trip_mode,mode_choice_logsum +309348571,644476,386761,escort,1,True,1,13,16,30934857,,,escort,,9,TNC_SHARED,-0.06869446957292412 +309348576,644476,386761,escort,1,False,2,7,13,30934857,,,othdiscr,34.81437482524035,9,WALK_LOC,-0.08996283484500237 +309348577,644476,386761,escort,2,False,2,16,7,30934857,,,home,,9,WALK_LOC,13.429241204717705 +309348581,644476,386761,escort,1,True,1,10,16,30934858,,,escort,,11,WALK,5.409024682061962 +309348586,644476,386761,escort,1,False,1,16,10,30934858,,,home,,14,WALK,5.435046360173753 +309348941,644476,386761,work,1,True,1,5,16,30934894,,,work,,17,WALK,2.8945188799248665 +309348946,644476,386761,work,1,False,3,7,5,30934894,,,othdiscr,34.7964953688577,23,WALK,3.3609167633247283 +309348947,644476,386761,work,2,False,3,25,7,30934894,,,othdiscr,49.04309399425222,23,WALK,10.266561475219047 +309348948,644476,386761,work,3,False,3,16,25,30934894,,,home,,23,WALK,9.227526911961686 +309349301,644477,386761,escort,1,True,1,22,16,30934930,644478,outbound,escort,,7,WALK,1.7200930889040627 +309349306,644477,386761,escort,1,False,4,25,22,30934930,,,shopping,35.05983050493184,8,WALK_LOC,1.732734180484371 +309349307,644477,386761,escort,2,False,4,10,25,30934930,,,eatout,51.49660496163193,8,WALK_LOC,12.266001539343675 +309349308,644477,386761,escort,3,False,4,7,10,30934930,,,social,53.10625450964672,8,WALK_LOC,9.991184842269428 +309349309,644477,386761,escort,4,False,4,16,7,30934930,,,home,,8,WALK_LOC,13.429241204360604 +309349311,644477,386761,escort,1,True,1,22,16,30934931,,,escort,,21,WALK,0.8780144968766603 +309349316,644477,386761,escort,1,False,1,16,22,30934931,644478,inbound,home,,21,WALK,1.050986038359338 +309349361,644477,386761,shopping,1,True,1,16,16,30934936,,,shopping,,16,WALK,7.330879513166791 +309349366,644477,386761,shopping,1,False,3,7,16,30934936,,,othmaint,44.623255268481685,17,WALK,5.7907998238012865 +309349367,644477,386761,shopping,2,False,3,6,7,30934936,,,shopping,55.81746628506744,17,WALK,14.258626223998164 +309349368,644477,386761,shopping,3,False,3,16,6,30934936,,,home,,17,WALK,11.139129206001668 +309349761,644478,386761,school,1,True,1,22,16,30934976,644478,outbound,school,,7,WALK,0.4463126906111215 +309349766,644478,386761,school,1,False,1,16,22,30934976,644478,inbound,home,,21,WALK,0.6143300219459862 +754876721,1572659,763879,shopping,1,True,2,7,6,75487672,,,othmaint,50.18293965974078,12,WALK,12.726227970364954 +754876722,1572659,763879,shopping,2,True,2,9,7,75487672,,,shopping,,12,WALK,8.712619806527924 +754876726,1572659,763879,shopping,1,False,3,7,9,75487672,,,shopping,49.840857938751334,12,WALK,8.868849917144606 +754876727,1572659,763879,shopping,2,False,3,8,7,75487672,,,shopping,52.319993702020405,12,WALK,12.536508241024563 +754876728,1572659,763879,shopping,3,False,3,6,8,75487672,,,home,,12,WALK,10.6804275133357 +783833801,1632987,824207,atwork,1,True,1,4,2,78383380,,,atwork,,10,WALK,0.46513864765320695 +783833806,1632987,824207,atwork,1,False,1,2,4,78383380,,,work,,10,WALK,0.5027251109936415 +783834221,1632987,824207,work,1,True,1,2,18,78383422,,,work,,7,TNC_SINGLE,0.6615056321818016 +783834226,1632987,824207,work,1,False,1,18,2,78383422,,,home,,13,TNC_SINGLE,0.595533806574623 +900346121,1875721,982875,atwork,1,True,1,13,12,90034612,,,atwork,,10,WALK,-0.3361803071638455 +900346126,1875721,982875,atwork,1,False,4,7,13,90034612,,,othmaint,35.35112772296722,13,WALK,-0.7572275237666953 +900346127,1875721,982875,atwork,2,False,4,7,7,90034612,,,eatout,62.62211920525311,13,WALK,14.469466216229574 +900346128,1875721,982875,atwork,3,False,4,7,7,90034612,,,social,62.98057490642787,13,WALK,14.469466216229574 +900346129,1875721,982875,atwork,4,False,4,12,7,90034612,,,work,,13,WALK,14.00322632440183 +900346541,1875721,982875,work,1,True,1,12,16,90034654,,,work,,6,WALK,3.2969091530341714 +900346546,1875721,982875,work,1,False,1,16,12,90034654,,,home,,15,WALK,3.2969090982643836 +900346621,1875722,982875,eatout,1,True,1,16,16,90034662,,,eatout,,11,WALK,7.330879548563644 +900346626,1875722,982875,eatout,1,False,1,16,16,90034662,,,home,,13,WALK,7.330879548563644 +1036347821,2159057,1099626,work,1,True,2,20,20,103634782,2159059,outbound,escort,,7,WALK,2.0731974644320226 +1036347822,2159057,1099626,work,2,True,2,2,20,103634782,,outbound,work,,7,WALK_LOC,-0.3600776021149732 +1036347826,2159057,1099626,work,1,False,1,20,2,103634782,,,home,,17,WALK_LOC,0.4350050428118264 +1036348161,2159058,1099626,univ,1,True,2,8,20,103634816,,,shopping,47.31933480733358,12,WALK,10.859926385389414 +1036348162,2159058,1099626,univ,2,True,2,9,8,103634816,,,univ,,13,WALK,9.848192645459868 +1036348166,2159058,1099626,univ,1,False,1,20,9,103634816,,,home,,17,WALK,9.7506325831761 +1036348641,2159059,1099626,school,1,True,1,20,20,103634864,2159059,outbound,school,,7,WALK,0.8283404251201736 +1036348646,2159059,1099626,school,1,False,1,20,20,103634864,,,home,,15,WALK,0.8234966917241893 +1232015381,2566698,1196298,escort,1,True,2,1,25,123201538,2566701_2566700,outbound,escort,,8,WALK,-1.2493589934903353 +1232015382,2566698,1196298,escort,2,True,2,24,1,123201538,2566700,outbound,escort,,8,WALK,3.081849626356409 +1232015386,2566698,1196298,escort,1,False,1,25,24,123201538,,,home,,8,WALK,3.070689441768197 +1232015501,2566698,1196298,work,1,True,1,1,25,123201550,,,work,,10,WALK,-0.07295434644232227 +1232015506,2566698,1196298,work,1,False,1,25,1,123201550,,,home,,20,TAXI,-0.4041229308810321 +1232016321,2566700,1196298,school,1,True,2,1,25,123201632,2566701_2566700,outbound,escort,,8,WALK,-1.6201980995433827 +1232016322,2566700,1196298,school,2,True,2,24,1,123201632,2566700,outbound,school,,8,WALK,2.5869838289906593 +1232016326,2566700,1196298,school,1,False,1,25,24,123201632,,,home,,21,WALK,2.576143443971975 +1232016801,2566701,1196298,school,1,True,1,1,25,123201680,2566701_2566700,outbound,school,,8,WALK,-1.6201980995433827 +1232016806,2566701,1196298,school,1,False,1,25,1,123201680,,,home,,16,WALK,-1.7718278808108805 +1232017281,2566702,1196298,school,1,True,1,2,25,123201728,,,school,,8,WALK_LOC,-0.12577374954461829 +1232017286,2566702,1196298,school,1,False,1,25,2,123201728,,,home,,15,WALK_LOC,-0.1952875067260073 +1469709521,3061894,1363467,shopping,1,True,2,7,24,146970952,,,othdiscr,44.88945443747221,12,WALK_LOC,13.44955992087016 +1469709522,3061894,1363467,shopping,2,True,2,11,7,146970952,,,shopping,,12,WALK_LOC,5.395740575779219 +1469709526,3061894,1363467,shopping,1,False,1,24,11,146970952,,,home,,12,WALK_LOC,4.845471745255901 +1469710001,3061895,1363467,shopping,1,True,1,21,24,146971000,,,shopping,,16,WALK_LOC,4.360128192512655 +1469710006,3061895,1363467,shopping,1,False,1,24,21,146971000,,,home,,16,WALK_LOC,4.318042993636196 +1469710061,3061895,1363467,work,1,True,1,2,24,146971006,,,work,,18,WALK,-0.11170571223054646 +1469710066,3061895,1363467,work,1,False,2,7,2,146971006,,,work,30.250272499754157,22,WALK,-0.5338931071696145 +1469710067,3061895,1363467,work,2,False,2,24,7,146971006,,,home,,23,WALK,9.848561346213632 +2002375521,4171615,1810015,univ,1,True,1,5,16,200237552,,,univ,,8,WALK_LOC,3.3778923355912447 +2002375526,4171615,1810015,univ,1,False,1,16,5,200237552,,,home,,13,WALK_LOC,3.367446345403806 +2002375971,4171616,1810015,othmaint,1,True,1,13,16,200237597,,,othmaint,,12,WALK,-0.4194315276605148 +2002375976,4171616,1810015,othmaint,1,False,1,16,13,200237597,,,home,,14,WALK,-0.4194317281725166 +2002376621,4171617,1810015,work,1,True,1,2,16,200237662,,,work,,6,WALK,0.4502882176559343 +2002376626,4171617,1810015,work,1,False,1,16,2,200237662,,,home,,13,WALK_LOC,0.3770192102658525 +2002377521,4171619,1810015,shopping,1,True,1,15,16,200237752,,,shopping,,15,WALK,0.8890200860995076 +2002377526,4171619,1810015,shopping,1,False,1,16,15,200237752,,,home,,15,WALK,0.7216237938903335 +2002377921,4171620,1810015,school,1,True,1,4,16,200237792,,,school,,7,WALK,-0.48035583077478106 +2002377926,4171620,1810015,school,1,False,1,16,4,200237792,,,home,,14,WALK,-0.48035789615878244 +2002378961,4171622,1810015,shopping,1,True,1,16,16,200237896,,,shopping,,17,WALK,7.330879449572421 +2002378966,4171622,1810015,shopping,1,False,1,16,16,200237896,,,home,,20,WALK,7.330879449572421 +2002379081,4171623,1810015,atwork,1,True,1,14,22,200237908,,,atwork,,11,WALK,1.094280494142762 +2002379086,4171623,1810015,atwork,1,False,1,22,14,200237908,,,work,,13,WALK,0.8611616643939847 +2002379501,4171623,1810015,work,1,True,1,22,16,200237950,,,work,,8,WALK,0.362388299138621 +2002379506,4171623,1810015,work,1,False,1,16,22,200237950,,,home,,18,WALK,0.4987830383258514 +3606007011,7512514,2821179,othmaint,1,True,1,1,8,360600701,,,othmaint,,9,WALK_LRF,0.7751207751649315 +3606007016,7512514,2821179,othmaint,1,False,1,8,1,360600701,,,home,,9,WALK_LRF,0.7208609722719941 +3606007121,7512514,2821179,shopping,1,True,1,5,8,360600712,,,shopping,,9,WALK,4.457538179557397 +3606007126,7512514,2821179,shopping,1,False,1,8,5,360600712,,,home,,10,WALK,4.457538178961434 +3606511661,7513565,2822230,work,1,True,1,2,8,360651166,,,work,,18,WALK,0.3877343038148696 +3606511666,7513565,2822230,work,1,False,1,8,2,360651166,,,home,,21,WALK_LRF,0.7444572495190103 diff --git a/activitysim/examples/prototype_mwcog/configs/atwork_subtour_frequency.csv b/activitysim/examples/prototype_mwcog/configs/atwork_subtour_frequency.csv index a4eec1a888..a07639de7e 100644 --- a/activitysim/examples/prototype_mwcog/configs/atwork_subtour_frequency.csv +++ b/activitysim/examples/prototype_mwcog/configs/atwork_subtour_frequency.csv @@ -4,7 +4,7 @@ util_dummy_for_non_full_time_worker,pemploy!=1,coefficient_dummy_for_non_full_ti util_dummy_for_non_workers,"ptype in [4, 5]",coefficient_dummy_for_non_workers_no_subtours,coefficient_dummy_for_non_workers_eat,coefficient_dummy_for_non_workers_business1,coefficient_dummy_for_non_workers_maint,coefficient_dummy_for_non_workers_business2,coefficient_dummy_for_non_workers_eat_business util_medium_hh_income_dummy,income_segment == 2,coefficient_medium_hh_income_dummy_no_subtours,coefficient_medium_hh_income_dummy_eat,coefficient_medium_hh_income_dummy_business1,coefficient_medium_hh_income_dummy_maint,coefficient_medium_hh_income_dummy_business2,coefficient_medium_hh_income_dummy_eat_business util_high_hh_income_dummy,(income_segment > 2) & (income_segment < 5),coefficient_high_hh_income_dummy_no_subtours,coefficient_high_hh_income_dummy_eat,coefficient_high_hh_income_dummy_business1,coefficient_high_hh_income_dummy_maint,coefficient_high_hh_income_dummy_business2,coefficient_high_hh_income_dummy_eat_business -util_zero_cars_owned_by_hh_dummy, auto_ownership == 0,coefficient_zero_cars_owned_by_hh_dummy_no_subtours,coefficient_zero_cars_owned_by_hh_dummy_eat,coefficient_zero_cars_owned_by_hh_dummy_business1,coefficient_zero_cars_owned_by_hh_dummy_maint,coefficient_zero_cars_owned_by_hh_dummy_business2,coefficient_zero_cars_owned_by_hh_dummy_eat_business +util_zero_cars_owned_by_hh_dummy,auto_ownership == 0,coefficient_zero_cars_owned_by_hh_dummy_no_subtours,coefficient_zero_cars_owned_by_hh_dummy_eat,coefficient_zero_cars_owned_by_hh_dummy_business1,coefficient_zero_cars_owned_by_hh_dummy_maint,coefficient_zero_cars_owned_by_hh_dummy_business2,coefficient_zero_cars_owned_by_hh_dummy_eat_business util_individual_discretionary_tours_made_by_full_time_worker,@(df.pemploy==1)*df.num_discr_tours,coefficient_individual_discretionary_tours_made_by_full_time_worker_no_subtours,coefficient_individual_discretionary_tours_made_by_full_time_worker_eat,coefficient_individual_discretionary_tours_made_by_full_time_worker_business1,coefficient_individual_discretionary_tours_made_by_full_time_worker_maint,coefficient_individual_discretionary_tours_made_by_full_time_worker_business2,coefficient_individual_discretionary_tours_made_by_full_time_worker_eat_business util_individual_discretionary_tours_made_by_part_time_worker,@(df.pemploy==2)*df.num_discr_tours,coefficient_individual_discretionary_tours_made_by_part_time_worker_no_subtours,coefficient_individual_discretionary_tours_made_by_part_time_worker_eat,coefficient_individual_discretionary_tours_made_by_part_time_worker_business1,coefficient_individual_discretionary_tours_made_by_part_time_worker_maint,coefficient_individual_discretionary_tours_made_by_part_time_worker_business2,coefficient_individual_discretionary_tours_made_by_part_time_worker_eat_business util_individual_eating_out_tours_made_by_person,num_eatout_tours,coefficient_individual_eating_out_tours_made_by_person_no_subtours,coefficient_individual_eating_out_tours_made_by_person_eat,coefficient_individual_eating_out_tours_made_by_person_business1,coefficient_individual_eating_out_tours_made_by_person_maint,coefficient_individual_eating_out_tours_made_by_person_business2,coefficient_individual_eating_out_tours_made_by_person_eat_business diff --git a/activitysim/examples/prototype_semcog/configs/atwork_subtour_frequency.csv b/activitysim/examples/prototype_semcog/configs/atwork_subtour_frequency.csv index a4eec1a888..a07639de7e 100755 --- a/activitysim/examples/prototype_semcog/configs/atwork_subtour_frequency.csv +++ b/activitysim/examples/prototype_semcog/configs/atwork_subtour_frequency.csv @@ -4,7 +4,7 @@ util_dummy_for_non_full_time_worker,pemploy!=1,coefficient_dummy_for_non_full_ti util_dummy_for_non_workers,"ptype in [4, 5]",coefficient_dummy_for_non_workers_no_subtours,coefficient_dummy_for_non_workers_eat,coefficient_dummy_for_non_workers_business1,coefficient_dummy_for_non_workers_maint,coefficient_dummy_for_non_workers_business2,coefficient_dummy_for_non_workers_eat_business util_medium_hh_income_dummy,income_segment == 2,coefficient_medium_hh_income_dummy_no_subtours,coefficient_medium_hh_income_dummy_eat,coefficient_medium_hh_income_dummy_business1,coefficient_medium_hh_income_dummy_maint,coefficient_medium_hh_income_dummy_business2,coefficient_medium_hh_income_dummy_eat_business util_high_hh_income_dummy,(income_segment > 2) & (income_segment < 5),coefficient_high_hh_income_dummy_no_subtours,coefficient_high_hh_income_dummy_eat,coefficient_high_hh_income_dummy_business1,coefficient_high_hh_income_dummy_maint,coefficient_high_hh_income_dummy_business2,coefficient_high_hh_income_dummy_eat_business -util_zero_cars_owned_by_hh_dummy, auto_ownership == 0,coefficient_zero_cars_owned_by_hh_dummy_no_subtours,coefficient_zero_cars_owned_by_hh_dummy_eat,coefficient_zero_cars_owned_by_hh_dummy_business1,coefficient_zero_cars_owned_by_hh_dummy_maint,coefficient_zero_cars_owned_by_hh_dummy_business2,coefficient_zero_cars_owned_by_hh_dummy_eat_business +util_zero_cars_owned_by_hh_dummy,auto_ownership == 0,coefficient_zero_cars_owned_by_hh_dummy_no_subtours,coefficient_zero_cars_owned_by_hh_dummy_eat,coefficient_zero_cars_owned_by_hh_dummy_business1,coefficient_zero_cars_owned_by_hh_dummy_maint,coefficient_zero_cars_owned_by_hh_dummy_business2,coefficient_zero_cars_owned_by_hh_dummy_eat_business util_individual_discretionary_tours_made_by_full_time_worker,@(df.pemploy==1)*df.num_discr_tours,coefficient_individual_discretionary_tours_made_by_full_time_worker_no_subtours,coefficient_individual_discretionary_tours_made_by_full_time_worker_eat,coefficient_individual_discretionary_tours_made_by_full_time_worker_business1,coefficient_individual_discretionary_tours_made_by_full_time_worker_maint,coefficient_individual_discretionary_tours_made_by_full_time_worker_business2,coefficient_individual_discretionary_tours_made_by_full_time_worker_eat_business util_individual_discretionary_tours_made_by_part_time_worker,@(df.pemploy==2)*df.num_discr_tours,coefficient_individual_discretionary_tours_made_by_part_time_worker_no_subtours,coefficient_individual_discretionary_tours_made_by_part_time_worker_eat,coefficient_individual_discretionary_tours_made_by_part_time_worker_business1,coefficient_individual_discretionary_tours_made_by_part_time_worker_maint,coefficient_individual_discretionary_tours_made_by_part_time_worker_business2,coefficient_individual_discretionary_tours_made_by_part_time_worker_eat_business util_individual_eating_out_tours_made_by_person,num_eatout_tours,coefficient_individual_eating_out_tours_made_by_person_no_subtours,coefficient_individual_eating_out_tours_made_by_person_eat,coefficient_individual_eating_out_tours_made_by_person_business1,coefficient_individual_eating_out_tours_made_by_person_maint,coefficient_individual_eating_out_tours_made_by_person_business2,coefficient_individual_eating_out_tours_made_by_person_eat_business diff --git a/conda-environments/activitysim-dev.yml b/conda-environments/activitysim-dev.yml index 1429426afe..a788b9e74c 100644 --- a/conda-environments/activitysim-dev.yml +++ b/conda-environments/activitysim-dev.yml @@ -55,7 +55,7 @@ dependencies: - rich - ruby # required for benchmarking pre-commit hooks - setuptools_scm -- sharrow >= 2.3.2 +- sharrow >= 2.5.2 - simwrapper > 1.7 - snakeviz # for profiling - sphinx diff --git a/conda-environments/docbuild.yml b/conda-environments/docbuild.yml index e0fe0f1bee..b6d1ebf5c1 100644 --- a/conda-environments/docbuild.yml +++ b/conda-environments/docbuild.yml @@ -41,7 +41,7 @@ dependencies: - pytest-regressions - pyyaml >= 5.1 - requests >= 2.7 -- sharrow >= 2.3.2 +- sharrow >= 2.5.2 - simwrapper > 1.7 - sphinx-argparse - sphinx_rtd_theme diff --git a/conda-environments/github-actions-tests.yml b/conda-environments/github-actions-tests.yml index d1660c7f13..13cbb8375c 100644 --- a/conda-environments/github-actions-tests.yml +++ b/conda-environments/github-actions-tests.yml @@ -26,7 +26,7 @@ dependencies: - pytest-regressions - pyyaml >= 5.1 - requests >= 2.7 -- sharrow >= 2.3.2 +- sharrow >= 2.5.2 - simwrapper > 1.7 - xarray >= 0.21 - zarr diff --git a/docs/examples.rst b/docs/examples.rst index e2d9359f25..add56f8b3b 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -1054,6 +1054,7 @@ 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. +* :ref:`school_escorting`: Explicitly models school drop-off / pick-up of students to and from school. The prototype_mtc_extended example also contains changes to test the flexible number of tour and trip ids. (Information in why this is important can be found `here `__.) diff --git a/docs/models.rst b/docs/models.rst index 84057727a5..5a38ea3fe5 100644 --- a/docs/models.rst +++ b/docs/models.rst @@ -534,6 +534,155 @@ Core Table: ``tours`` | Result Field: ``start, end, duration`` | Skims Keys: ``T :members: +.. _school_escorting: + +School Escorting +---------------- + +The school escort model determines whether children are dropped-off at or picked-up from school, +simultaneously with the chaperone responsible for chauffeuring the children, +which children are bundled together on half-tours, and the type of tour (pure escort versus rideshare). +The model is run after work and school locations have been chosen for all household members, +and after work and school tours have been generated and scheduled. +The model labels household members of driving age as potential ‘chauffeurs’ and children with school tours as potential ‘escortees’. +The model then attempts to match potential chauffeurs with potential escortees in a choice model whose alternatives +consist of ‘bundles’ of escortees with a chauffeur for each half tour. + +School escorting is a household level decision – each household will choose an alternative from the ``school_escorting_alts.csv`` file, +with the first alternative being no escorting. This file contains the following columns: + ++------------------------------------------------+--------------------------------------------------------------------+ +| Column Name | Column Description | ++================================================+====================================================================+ +| Alt | Alternative number | ++------------------------------------------------+--------------------------------------------------------------------+ +| bundle[1,2,3] | bundle number for child 1,2, and 3 | ++------------------------------------------------+--------------------------------------------------------------------+ +| chauf[1,2,3] | chauffeur number for child 1,2, and 3 | +| | - 0 = child not escorted | +| | - 1 = chauffeur 1 as ride share | +| | - 2 = chauffeur 1 as pure escort | +| | - 3 = chauffeur 2 as ride share | +| | - 4 = chauffeur 3 as pure escort | ++------------------------------------------------+--------------------------------------------------------------------+ +| nbund[1,2] | - number of escorting bundles for chauffeur 1 and 2 | ++------------------------------------------------+--------------------------------------------------------------------+ +| nbundles | - total number of bundles | +| | - equals nbund1 + nbund2 | ++------------------------------------------------+--------------------------------------------------------------------+ +| nrs1 | - number of ride share bundles for chauffeur 1 | ++------------------------------------------------+--------------------------------------------------------------------+ +| npe1 | - number of pure escort bundles for chauffeur 1 | ++------------------------------------------------+--------------------------------------------------------------------+ +| nrs2 | - number of ride share bundles for chauffeur 2 | ++------------------------------------------------+--------------------------------------------------------------------+ +| npe2 | - number of pure escort bundles for chauffeur 2 | ++------------------------------------------------+--------------------------------------------------------------------+ +| Description | - text description of alternative | ++------------------------------------------------+--------------------------------------------------------------------+ + +The model as currently implemented contains three escortees and two chauffeurs. +Escortees are students under age 16 with a mandatory tour whereas chaperones are all persons in the household over the age of 18. +For households that have more than three possible escortees, the three youngest children are selected for the model. +The two chaperones are selected as the adults of the household with the highest weight according to the following calculation: +:math:`Weight = 100*personType + 10*gender + 1*age(0,1)` +Where *personType* is the person type number from 1 to 5, *gender* is 1 for male and 2 for female, and +*age* is a binary indicator equal to 1 if age is over 25 else 0. + +The model is run sequentially three times, once in the outbound direction, once in the inbound direction, +and again in the outbound direction with additional conditions on what happened in the inbound direction. +There are therefore three sets of utility specifications, coefficients, and pre-processor files. +Each of these files is specified in the school_escorting.yaml file along with the number of escortees and number of chaperones. + +There is also a constants section in the school_escorting.yaml file which contain two constants. +One which sets the maximum time bin difference to match school and work tours for ride sharing +and another to set the number of minutes per time bin. +In the :ref:`prototype_mtc_extended` example, these are set to 1 and 60 respectively. + +After a school escorting alternative is chosen for the inbound and outbound direction, the model will +create the tours and trips associated with the decision. Pure escort tours are created, +and the mandatory tour start and end times are changed to match the school escort bundle start and end times. +(Outbound tours have their start times matched and inbound tours have their end times matched.) +Escortee drop-off / pick-up order is determined by the distance from home to the school locations. +They are ordered from smallest to largest in the outbound direction, and largest to smallest in the inbound direction. +Trips are created for each half-tour that includes school escorting according to the provided order. + +The created pure escort tours are joined to the already created mandatory tour table in the pipeline +and are also saved separately to the pipeline under the table name “school_escort_tours”. +Created school escorting trips are saved to the pipeline under the table name “school_escort_trips”. +By saving these to the pipeline, their data can be queried in downstream models to set correct purposes, +destinations, and schedules to satisfy the school escorting model choice. + +There are a host of downstream model changes that are involved when including the school escorting model. +The following list contains the models that are changed in some way when school escorting is included: + + * **Joint tour scheduling:** Joint tours are not allowed to be scheduled over school escort tours. + This happens automatically by updating the timetable object with the updated mandatory tour times + and created pure escort tour times after the school escorting model is run. + There were no code or config changes in this model, but it is still affected by school escorting. + * **Non-Mandatory tour frequency:** Pure school escort tours are joined to the tours created in the + non-mandatory tour frequency model and tour statistics (such as tour_count and tour_num) are re-calculated. + * **Non-Mandatory tour destination:** Since the primary destination of pure school escort tours is known, + they are removed from the choosers table and have their destination set according to the destination in\ + school_escort_tours table. They are also excluded from the estimation data bundle. + * **Non-Mandatory tour scheduling:** Pure escort tours need to have the non-escorting portion of their tour scheduled. + This is done by inserting availability conditions in the model specification that ensures the alternative + chosen for the start of the tour is equal to the alternative start time for outbound tours and the end time + is equal to the alternative end time for the inbound tours. There are additional terms that ensure the tour + does not overlap with subsequent school escorting tours as well. Beware -- If the availability conditions + in the school escorting model are not set correctly, the tours created may not be consistent with each other + and this model will fail. + * **Tour mode choice:** Availability conditions are set in tour mode choice to prohibit the drive alone mode + if the tour contains an escortee and the shared-ride 2 mode if the tour contains more than one escortee. + * **Stop Frequency:** No stops are allowed on half-tours that include school escorting. + This is enforced by adding availability conditions in the stop frequency model. After the stop frequency + model is run, the school escorting trips are merged from the trips created by the stop frequency model + and a new stop frequency is computed along with updated trip numbers. + * **Trip purpose, destination, and scheduling:** Trip purpose, destination, and departure times are known + for school escorting trips. As such they are removed from their respective chooser tables and the estimation + data bundles, and set according to the values in the school_escort_trips table residing in the pipeline. + * **Trip mode choice:** Like in tour mode choice, availability conditions are set to prohibit trip containing + an escortee to use the drive alone mode or the shared-ride 2 mode for trips with more than one escortee. + +Many of the changes discussed in the above list are handled in the code and the user is not required to make any +changes when implementing the school escorting model. However, it is the users responsibility to include the +changes in the following model configuration files for models downstream of the school escorting model: + ++--------------------------------------------------------------------+------------------------------------------------------------------+ +| File Name(s) | Change(s) Needed | ++====================================================================+==================================================================+ +| - `non_mandatory_tour_scheduling_annotate_tours_preprocessor.csv` | | +| - `tour_scheduling_nonmandatory.csv` | - Set availability conditions based on those times | +| | - Do not schedule over other school escort tours | ++--------------------------------------------------------------------+------------------------------------------------------------------+ +| - `tour_mode_choice_annotate_choosers_preprocessor.csv` | - count number of escortees on tour by parsing the | +| - `tour_mode_choice.csv` | ``escort_participants`` column | +| | - set mode choice availability based on number of escortees | +| | | ++--------------------------------------------------------------------+------------------------------------------------------------------+ +| - `stop_frequency_school.csv` | Do not allow stops for half-tours that include school escorting | +| - `stop_frequency_work.csv` | | +| - `stop_frequency_univ.csv` | | +| - `stop_frequency_escort.csv` | | ++--------------------------------------------------------------------+------------------------------------------------------------------+ +| - `trip_mode_choice_annotate_trips_preprocessor.csv` | - count number of escortees on trip by parsing the | +| - `trip_mode_choice.csv` | ``escort_participants`` column | +| | - set mode choice availability based on number of escortees | +| | | ++--------------------------------------------------------------------+------------------------------------------------------------------+ + +When not including the school escorting model, all of the escort trips to and from school are counted implicitly in +escort tours determined in the non-mandatory tour frequency model. Thus, when including the school escort model and +accounting for these tours explicitly, extra care should be taken not to double count them in the non-mandatory +tour frequency model. The non-mandatory tour frequency model should be re-evaluated and likely changed to decrease +the number of escort tours generated by that model. This was not implemented in the :ref:`prototype_mtc_extended` +implementation due to a lack of data surrounding the number of escort tours in the region. + + +.. automodule:: activitysim.abm.models.school_escorting + :members: + + .. _joint_tour_frequency: Joint Tour Frequency diff --git a/setup.cfg b/setup.cfg index 4b878a9e87..6eaa64d182 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ install_requires = pypyr >= 5.3 pyyaml >= 5.1 requests >= 2.7 - sharrow >= 2.3.2 + sharrow >= 2.5 simwrapper > 1.7 tables >= 3.5.1 xarray >= 0.21