Skip to content

Commit

Permalink
BayDAG Contribution #15: Larch Interface for Added Models (#781)
Browse files Browse the repository at this point in the history
* adding calls to larch for new simple simulate models

* blacken
  • Loading branch information
dhensle authored Mar 28, 2024
1 parent 97e45b7 commit 27d5b36
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions activitysim/estimation/larch/simple_simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,22 @@ def free_parking_model(
)


def work_from_home_model(
name="work_from_home",
edb_directory="output/estimation_data_bundle/{name}/",
return_data=False,
):
return simple_simulate_model(
name=name,
edb_directory=edb_directory,
return_data=return_data,
choices={
True: 1,
False: 2,
}, # True is work from home, false is does not work from home, names match spec positions
)


def mandatory_tour_frequency_model(
name="mandatory_tour_frequency",
edb_directory="output/estimation_data_bundle/{name}/",
Expand Down Expand Up @@ -295,3 +311,54 @@ def joint_tour_participation_model(
1: 2, # 1 means not participate, alternative 2
},
)


def transit_pass_subsidy_model(
name="transit_pass_subsidy",
edb_directory="output/estimation_data_bundle/{name}/",
return_data=False,
):
print("transit pass subsidy")
return simple_simulate_model(
name=name,
edb_directory=edb_directory,
return_data=return_data,
choices={
0: 1, # 0 means no subsidy, alternative 1
1: 2, # 1 means subsidy, alternative 2
},
)


def transit_pass_ownership_model(
name="transit_pass_ownership",
edb_directory="output/estimation_data_bundle/{name}/",
return_data=False,
):
return simple_simulate_model(
name=name,
edb_directory=edb_directory,
return_data=return_data,
choices={
0: 1, # 0 means no pass, alternative 1
1: 2, # 1 means pass, alternative 2
},
)


def telecommute_frequency_model(
name="telecommute_frequency",
edb_directory="output/estimation_data_bundle/{name}/",
return_data=False,
):
return simple_simulate_model(
name=name,
edb_directory=edb_directory,
return_data=return_data,
choices={
"No_Telecommute": 1,
"1_day_week": 2,
"2_3_days_week": 3,
"4_days_week": 4,
},
)

0 comments on commit 27d5b36

Please sign in to comment.