Coordinated Daily Activity Pattern#

The Coordinated Daily Activity Pattern (CDAP) model predicts the choice of daily activity pattern (DAP) for each member in the household, simultaneously. The DAP is categorized in to three types as follows:

  • Mandatory: the person engages in travel to at least one out-of-home mandatory activity - work, university, or school. The mandatory pattern may also include non-mandatory activities such as separate home-based tours or intermediate stops on mandatory tours.

  • Non-mandatory: the person engages in only maintenance and discretionary tours, which, by definition, do not contain mandatory activities.

  • Home: the person does not travel outside the home.

The CDAP model is a sequence of vectorized table operations:

  • create a person level table and rank each person in the household for inclusion in the CDAP model. Priority is given to full time workers (up to two), then to part time workers (up to two workers, of any type), then to children (youngest to oldest, up to three). Additional members up to five are randomly included for the CDAP calculation.

  • solve individual M/N/H utilities for each person

  • take as input an interaction coefficients table and then programmatically produce and write out the expression files for households size 1, 2, 3, 4, and 5 models independent of one another

  • select households of size 1, join all required person attributes, and then read and solve the automatically generated expressions

  • repeat for households size 2, 3, 4, and 5. Each model is independent of one another.

The main interface to the CDAP model is the run_cdap function. This function is called by the Inject step cdap_simulate which is registered as an Inject step in the example Pipeline. There are two cdap class definitions in ActivitySim. The first is at cdap and contains the Inject wrapper for running it as part of the model pipeline. The second is at cdap and contains CDAP model logic.

Structure#

  • Configuration File: cdap.yaml

  • Core Table: persons

  • Result Field: cdap_activity

Configuration#

settings activitysim.abm.models.cdap.CdapSettings#

Bases: PydanticReadable

Fields:
field ADD_JOINT_TOUR_UTILITY: bool = False#
field COEFFICIENTS: Path [Required]#
field CONSTANTS: dict[str, Any] = {}#
field FIXED_RELATIVE_PROPORTIONS_SPEC: str = 'cdap_fixed_relative_proportions.csv'#
field INDIV_AND_HHSIZE1_SPEC: str [Required]#
field INTERACTION_COEFFICIENTS: str = 'cdap_interaction_coefficients.csv'#
field JOINT_TOUR_COEFFICIENTS: str = 'cdap_joint_tour_coefficients.csv'#
field PERSON_TYPE_MAP: dict[str, list[int]] [Required]#
field annotate_households: PreprocessorSettings | None = None#
field annotate_persons: PreprocessorSettings | None = None#

Examples#

Implementation#

activitysim.abm.models.cdap.cdap_simulate(state: State, persons_merged: DataFrame, persons: DataFrame, households: DataFrame, model_settings: Optional[CdapSettings] = None, model_settings_file_name: str = 'cdap.yaml', trace_label: str = 'cdap') None#

CDAP stands for Coordinated Daily Activity Pattern, which is a choice of high-level activity pattern for each person, in a coordinated way with other members of a person’s household.

Because Python requires vectorization of computation, there are some specialized routines in the cdap directory of activitysim for this purpose. This module simply applies those utilities using the simulation framework.