Trip Purpose and Destination#

After running trip purpose and trip destination separately, the two model can be ran together in an iterative fashion on the remaining failed trips (i.e. trips that cannot be assigned a destination). Each iteration uses new random numbers.

The main interface to the trip purpose model is the trip_purpose_and_destination function. This function is registered as an Inject step in the example Pipeline.

Structure#

  • Core Table: trips

  • Result Field: purpose, destination

  • Skims Keys: origin, (tour primary) destination, dest_taz, trip_period

Configuration#

settings activitysim.abm.models.trip_purpose_and_destination.TripPurposeAndDestinationSettings#

Bases: PydanticReadable

Settings for the trip_purpose_and_destination component.

Fields:
field MAX_ITERATIONS: int = 5#

Setting for the maximum iterations

field source_file_paths: list[Path] = None#

A list of source files from which these settings were loaded.

This value should not be set by the user within the YAML settings files, instead it is populated as those files are loaded. It is primarily provided for debugging purposes, and does not actually affect the operation of any model.

Examples#

Implementation#

activitysim.abm.models.trip_purpose_and_destination.trip_purpose_and_destination(state: State, trips: DataFrame, tours_merged: DataFrame, model_settings: TripPurposeAndDestinationSettings | None = None, model_settings_file_name: str = 'trip_purpose_and_destination.yaml', trace_label: str = 'trip_purpose_and_destination') → None#