Skip to content
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

Provide more flexibility for defining mandatory schedule specifications. #275

Merged
merged 7 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions activitysim/abm/models/mandatory_scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,9 @@ def mandatory_tour_scheduling(tours,
mandatory_tours.tour_type.where(~is_university_tour, 'univ')

# - spec dict segmented by primary_purpose
work_spec = simulate.read_model_spec(file_name='tour_scheduling_work.csv')
school_spec = simulate.read_model_spec(file_name='tour_scheduling_school.csv')
segment_specs = {
'work': work_spec,
'school': school_spec,
'univ': school_spec
}
specs = model_settings.get('SPEC', [])
segment_specs = {segment: simulate.read_model_spec(file_name=spec)
for segment, spec in specs.items()}

logger.info("Running mandatory_tour_scheduling with %d tours", len(tours))
tdd_choices, timetable = vts.vectorize_tour_scheduling(
Expand Down
4 changes: 4 additions & 0 deletions activitysim/abm/test/configs/mandatory_tour_scheduling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ LOGSUM_SETTINGS: tour_mode_choice.yaml

SEGMENT_COL: primary_purpose

SPEC:
work: tour_scheduling_work.csv
school: tour_scheduling_school.csv
univ: tour_scheduling_school.csv

#CHOOSER_ORIG_COL_NAME: TAZ

Expand Down
4 changes: 4 additions & 0 deletions example/configs/mandatory_tour_scheduling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ SIMULATE_CHOOSER_COLUMNS:

LOGSUM_SETTINGS: tour_mode_choice.yaml

SPEC:
work: tour_scheduling_work.csv
school: tour_scheduling_school.csv
univ: tour_scheduling_school.csv

#CHOOSER_ORIG_COL_NAME: TAZ

Expand Down