Parking Location Choice#

The parking location choice model selects a parking location for specified trips. While the model does not require parking location be applied to any specific set of trips, it is usually applied for drive trips to specific zones (e.g., CBD) in the model.

The model provides provides a filter for both the eligible choosers and eligible parking location zone. The trips dataframe is the chooser of this model. The zone selection filter is applied to the land use zones dataframe.

If this model is specified in the pipeline, the Write Trip Matrices_ step will using the parking location choice results to build trip tables in lieu of the trip destination.

The main interface to the trip mode choice model is the parking_location_choice function. This function is registered as an Inject step, and it is available from the pipeline.

Structure#

  • Configuration File: parking_location_choice.yaml

  • Core Table: trips

  • Result: omx trip matrices

  • Skims: odt_skims: Origin to Destination by Time of Day, dot_skims: Destination to Origin by Time of Day, opt_skims: Origin to Parking Zone by Time of Day, pdt_skims: Parking Zone to Destination by Time of Day, od_skims: Origin to Destination, do_skims: Destination to Origin, op_skims: Origin to Parking Zone, pd_skims: Parking Zone to Destination

Required YAML attributes:#

  • SPECIFICATION: This file defines the logit specification for each chooser segment.

  • COEFFICIENTS: Specification coefficients

  • PREPROCESSOR: Preprocessor definitions to run on the chooser dataframe (trips) before the model is run

  • CHOOSER_FILTER_COLUMN_NAME: Boolean field on the chooser table defining which choosers are eligible to parking location choice model. If no filter is specified, all choosers (trips) are eligible for the model.

  • CHOOSER_SEGMENT_COLUMN_NAME: Column on the chooser table defining the parking segment for the logit model

  • SEGMENTS: List of eligible chooser segments in the logit specification

  • ALTERNATIVE_FILTER_COLUMN_NAME: Boolean field used to filter land use zones as eligible parking location choices. If no filter is specified, then all land use zones are considered as viable choices.

  • ALT_DEST_COL_NAME: The column name to append with the parking location choice results. For choosers (trips) ineligible for this model, a -1 value will be placed in column.

  • TRIP_ORIGIN: Origin field on the chooser trip table

  • TRIP_DESTINATION: Destination field on the chooser trip table

Configuration#

settings activitysim.abm.models.parking_location_choice.ParkingLocationSettings#

Bases: LogitComponentSettings

Settings for the parking_location component.

Fields:
Validators:
  • nests_are_for_nl » NESTS

field ALTERNATIVE_FILTER_COLUMN_NAME: str [Required]#
field ALT_DEST_COL_NAME: str = 'parking_zone'#

Parking destination column name.

field CHOOSER_FILTER_COLUMN_NAME: str [Required]#

A boolean column to filter choosers.

If this column evaluates as True the row will be kept.

field CHOOSER_SEGMENT_COLUMN_NAME: str [Required]#
field COEFFICIENTS: Path | None = None#

Coefficients filename.

This is a CSV file giving named parameters for use in the utility expression. If it is not provided, then it is assumed that all model coefficients are given explicitly in the SPEC as numerical values instead of named parameters. This is perfectly acceptable for use with ActivitySim for typical simulation applications, but may be problematic if used with “estimation mode”.

field CONSTANTS: dict[str, Any] = {}#

Named constants usable in the utility expressions.

field DEST_CHOICE_SAMPLE_TABLE_NAME: str | None = None#
field LOGIT_TYPE: Literal['MNL', 'NL'] = 'MNL'#

Logit model mathematical form.

  • “MNL”

    Multinomial logit model.

  • “NL”

    Nested multinomial logit model.

field NESTS: LogitNestSpec | None = None#

Nesting structure for a nested logit model.

The nesting structure is specified heirarchically from the top, so the value of this field should be the “root” level nest of the nested logit tree, which should contain references to lower level nests and/or the actual alternatives.

For example, this YAML defines a simple nesting structure for four alternatives (DRIVE, WALK, WALK_TO_TRANSIT, DRIVE_TO_TRANSIT) with the two transit alternatives grouped together in a nest:

NESTS:
  name: root
  coefficient: coef_nest_root
  alternatives:
    - DRIVE
    - WALK
    - name: TRANSIT
      coefficient: coef_nest_transit
      alternatives:
      - WALK_TO_TRANSIT
      - DRIVE_TO_TRANSIT
Validated by:
  • nests_are_for_nl

field PARKING_LOCATION_SAMPLE_TABLE_NAME: str | None = None#
field PREPROCESSOR: PreprocessorSettings | None = None#

Setting for the preprocessor.

field SEGMENTS: list[str] | None = None#
field SPEC: None = None#

The school escort model does not use this setting, see SPECIFICATION.

field SPECIFICATION: Path | None = None#
field TRIP_DEPARTURE_PERIOD: str = 'stop_period'#

Trip departure time period.

field TRIP_DESTINATION: str = 'destination'#
field TRIP_ORIGIN: str = 'origin'#
field sharrow_skip: bool = False#

Skip sharrow when evaluating this component.

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.

validator nests_are_for_nl  »  NESTS#

Checks that nests are provided if (and only if) LOGIT_TYPE is NL.

Examples#

Implementation#

activitysim.abm.models.parking_location_choice.parking_location(state: State, trips: DataFrame, trips_merged: DataFrame, land_use: DataFrame, network_los: Network_LOS, model_settings: Optional[ParkingLocationSettings] = None, model_settings_file_name: str = 'parking_location_choice.yaml', trace_label: str = 'parking_location') None#

Given a set of trips, each trip needs to have a parking location if it is eligible for remote parking.

activitysim.abm.models.parking_location_choice.wrap_skims(state: State, model_settings: ParkingLocationSettings)#

wrap skims of trip destination using origin, dest column names from model settings. Various of these are used by destination_sample, compute_logsums, and destination_simulate so we create them all here with canonical names.

Note that compute_logsums aliases their names so it can use the same equations to compute logsums from origin to alt_dest, and from alt_dest to primarly destination

odt_skims - SkimStackWrapper: trip origin, trip alt_dest, time_of_day dot_skims - SkimStackWrapper: trip alt_dest, trip origin, time_of_day dpt_skims - SkimStackWrapper: trip alt_dest, trip primary_dest, time_of_day pdt_skims - SkimStackWrapper: trip primary_dest,trip alt_dest, time_of_day od_skims - SkimDictWrapper: trip origin, trip alt_dest dp_skims - SkimDictWrapper: trip alt_dest, trip primary_dest

Parameters:
model_settings
Returns:
dict containing skims, keyed by canonical names relative to tour orientation
activitysim.abm.models.parking_location_choice.parking_destination_simulate(state: State, segment_name, trips, destination_sample, model_settings: ParkingLocationSettings, skims, chunk_size, trace_hh_id, trace_label)#

Chose destination from destination_sample (with od_logsum and dp_logsum columns added)

Returns:
choices - pandas.Series

destination alt chosen