Skip to content

Add telecommute status model #935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

i-am-sijia
Copy link
Contributor

@i-am-sijia i-am-sijia commented Apr 6, 2025

This PR adds the software infrastructure to implement a telecommute status model that explicitly identifies workers who telecommute on the simulation day. This work is funded under Phase 9B.

The software adds a is_telecommuting attribute to the persons table. A simple implementation of the telecommute status model can be based on the worker's telecommute frequency. For example, if a worker telecommutes 4 days a week, then there is a 80% probability for them to telecommute on the simulation day. The telecommute status model software can accommodate more complex model forms if needed. An example telecommute status model specification can be found in ActivitySim/sandag-abm3-example#30

In addition to identifying workers who telecommute on the simulation day, we would also like to explicitly simulate their work activities on the day and let that influence non-work activities. The original scope includes overwriting the simulation day work location to home for workers who telecommute on the day, and using the existing ActivitySim mandatory tour generation submodels to simulate in-home work activities. Upon further discussion with the Consortium, we decided to not fully implement the original scope. Therefore this PR does not include the software changes to overwrite the simulation day work location to home.

There are other options to explicitly simulate telecommute behaviors on the simulation day. The Consortium is currently engaged in an explicit telecommute design task to decide the model and software design.

Related issue: #736

@jpn-- jpn-- requested a review from Copilot July 17, 2025 18:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a telecommute status model to predict whether workers telecommute on the simulation day. The model extends existing ActivitySim telecommute representation by adding a new binary model that determines daily telecommute behavior based on worker characteristics and telecommute frequency.

Key changes include:

  • Implementation of a new telecommute status model with configurable probability-based logic
  • Addition of documentation explaining model purpose and integration considerations
  • Support for estimation workflow integration

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
docs/dev-guide/components/telecommute_status.md Comprehensive documentation for the telecommute status model component
activitysim/estimation/larch/simple_simulate.py Estimation support function for telecommute status model
activitysim/abm/models/telecommute_status.py Core implementation of the telecommute status prediction model
activitysim/abm/models/__init__.py Module import registration for the new telecommute status component

i-am-sijia and others added 2 commits July 17, 2025 17:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jpn-- jpn-- requested a review from dhensle July 24, 2025 18:12
Copy link
Contributor

@dhensle dhensle left a comment

Choose a reason for hiding this comment

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

This model would be included in our CI test system through the SANDAG example model configs. However, the currently open PR (ActivitySim/sandag-abm3-example#30) does more than just add telecommute status configs. I think the configs in that PR are out of date with what is desired for pulling in this code considering it has changes in CDAP and non-mandatory tour frequency. Do we want to just create a new PR into the sandag-abm3-example for just the telecommute_status configs and leave the rest open for future telecommute enhancements?

@@ -49,4 +49,5 @@
vehicle_allocation,
vehicle_type_choice,
work_from_home,
telecommute_status,
Copy link
Contributor

Choose a reason for hiding this comment

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

while not actually important or necessary, it would please me to have this moved up into alphabetical order like the rest of the models :)

"""

preprocessor: PreprocessorSettings | None = None
"""Setting for the preprocessor."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Can remove the preprocessor since it is no longer needed after merging in #957 (exists as part of the LogitComponentSettings now)

Comment on lines +67 to +80
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:
locals_d = {}
if constants is not None:
locals_d.update(constants)

expressions.assign_columns(
state,
df=choosers,
model_settings=preprocessor_settings,
locals_dict=locals_d,
trace_label=trace_label,
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# - preprocessor
preprocessor_settings = model_settings.preprocessor
if preprocessor_settings:
locals_d = {}
if constants is not None:
locals_d.update(constants)
expressions.assign_columns(
state,
df=choosers,
model_settings=preprocessor_settings,
locals_dict=locals_d,
trace_label=trace_label,
)
expressions.annotate_preprocessors(
state,
df=choosers,
locals_dict={} if constants is None else constants,
skims=None,
model_settings=model_settings,
trace_label=trace_label,
)

Update with the new preprocessor function call

some suggest it should be applied after the CDAP model only to workers who have work activities
during the day regardless of in-home or out-of-home (which requires change in CDAP definition).
The Consortium is currently engaged in an explicit telecommute design task as part of Phase 9B,
out of which more guidance on the model sequence will be established.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this text be updated to reflect the most recent design decisions around telecommuting?

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.

None yet

3 participants