Repository navigation
Explicit Telecommute: new telework_arrangement and telework_duration components - #1126
i-am-sijia wants to merge 11 commits into
Conversation
JoeJimFlood
left a comment
There was a problem hiding this comment.
Looks great! I just had a couple comments over small things.
| estimator.end_estimation() | ||
|
|
||
| persons["has_in_home_work_activity"] = ( | ||
| choices.reindex(persons.index).fillna(0).astype(bool) |
There was a problem hiding this comment.
It looks like a value of 0 in this field indicates that a person has in-home work activities by default. So would this mean that people with null values are assumed to have in-home work activities?
| Settings for the `telework_duration` component. | ||
| """ | ||
|
|
||
| CHOICE_MODEL: Literal["PROBABILISTIC", "MNL"] = "PROBABILISTIC" |
There was a problem hiding this comment.
Would LOGIT be the better option here instead of MNL to avoid confusion with the LOGIT_TYPE setting?
| estimator.write_override_choices(choices) | ||
| estimator.end_estimation() | ||
|
|
||
| persons["has_in_home_work_activity"] = ( |
There was a problem hiding this comment.
This is more of a general ActivitySim comment: I've noticed that in some model components (such as this one) the name(s) of the column with the choice is(are) hardcoded, but in others (such as telework duration in this PR) the name(s) is(are) defined in the model settings. Should this be consistent?
| @pytest.fixture(scope="module") | ||
| def households() -> pd.DataFrame: | ||
| households = pd.DataFrame( | ||
| { |
There was a problem hiding this comment.
Inconsistent formatting between this and how the persons table is defined. Perhaps the differences in the number of the rows are on either side of a formatter's threshold on lists being displayed horizontally vs vertically?
This pull request adds two new model components to the ActivitySim ABM:
telework_arrangementandtelework_duration. These components enable the simulation of whether a worker has in-home work activity (telework) on a given day and, if so, the duration of their telework. The changes include new model step implementations, settings classes, unit tests, and integration into the settings checker and model initialization.New telework modeling components:
telework_arrangementmodel step and its settings class (TeleworkArrangementSettings), which predicts whether workers have in-home telework activity on the simulation day. This includes a new implementation filetelework_arrangement.py.telework_durationmodel step and its settings class (TeleworkDurationSettings), which assigns a duration to in-home work activities using either a probabilistic or MNL choice model. This includes a new implementation filetelework_duration.py.Integration with ActivitySim ABM framework:
telework_arrangementandtelework_durationcomponents in the ABM model's initialization (__init__.py).Unit test
telework_duration, unit tests for both MNL and probabilistic options are available.Estimation Memo
As requested in meetings, a GitHub hosted memo is preferrable. Therefore, this PR also expanded the new markdown files for the two components to include:
The markdown files also identify data required to perform calibration using the current specification, and discuss additional data items that may not be currently available, but which could inform future data collection and model improvements.