Skip to content

Conversation

@dhensle
Copy link
Collaborator

@dhensle dhensle commented Oct 1, 2025

Draft PR of initial code implementation of both the intra-household AV allocation and taxi/TNC routing models.

Mode detailed description of code changes forthcoming.

return skims, interaction_df


def construct_av_to_trip_alternatives(num_avs, num_trips):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For large households/trips, this could be slow. Shall we consider limiting alternatives if performance is an issue?

return choices


def get_next_household_trips_to_service(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible making hardcoded values (e.g., number of next trips to service) configurable via settings?

Copy link
Contributor

@JiaXu1024 JiaXu1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The AV allocation model is not directly integrated with the main ActivitySim model pipeline. Could you update the config file to include it in the workflow?


class TaxiTNCSettings(BaseModel):
"""
Taxi / TNC route choice settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 14–66 appear to duplicate the settings in taxi_tnc_routing_settings.yaml. Could you remove the redundant entries? I also noticed that single_tnc_modes doesn’t match the value in the YAML file.

"\n",
"landuse_file = r\"C:\\projects\\sandag\\av_tnc_routing\\av_run_dir\\tnc_routing_data\\final_land_use.csv\"\n",
"omx_path = r\"C:\\projects\\sandag\\av_tnc_routing\\av_run_dir\\input_data_full\\skims\\traffic_skims_MD.omx\"\n",
"skim_core = \"SOV_TR_H_DIST__MD\""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skim_core is different from settings as default setting is shared-ride 2 high value-of-time skim.

def write_outputs(self, tnc_veh_trips, pooled_trips, id_mapping_df):
"""Write final tables to output folder"""
tnc_veh_trips.to_csv(
os.path.join(self.settings.output_dir, "output_tnc_vehicle_trips.csv"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this output file equivalent to the old TNCTrips.csv? If yes, could you rename it to use the same file name as before?

index=True,
)
pooled_trips.to_csv(
os.path.join(self.settings.output_dir, "output_tnc_pooled_trips.csv"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn’t notice the pooled trips output referenced in the TNC summaries. Is it already captured in output_tnc_vehicle_trips?

@JiaXu1024
Copy link
Contributor

Were the demand matrix files produced using the updated model as well? i.e. TNCVehicleTrips_[time_period].omx and emptyAVTrips.omx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants