Skip to content

Commit 7db24a6

Browse files
authored
Merge pull request #275 from danielsclint/ft_schedule_flex
Provide more flexibility for defining mandatory schedule specifications.
2 parents 174b5e6 + c9f890e commit 7db24a6

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

activitysim/abm/models/mandatory_scheduling.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,9 @@ def mandatory_tour_scheduling(tours,
7474
mandatory_tours.tour_type.where(~is_university_tour, 'univ')
7575

7676
# - spec dict segmented by primary_purpose
77-
work_spec = simulate.read_model_spec(file_name='tour_scheduling_work.csv')
78-
school_spec = simulate.read_model_spec(file_name='tour_scheduling_school.csv')
79-
segment_specs = {
80-
'work': work_spec,
81-
'school': school_spec,
82-
'univ': school_spec
83-
}
77+
specs = model_settings.get('SPEC', [])
78+
segment_specs = {segment: simulate.read_model_spec(file_name=spec)
79+
for segment, spec in specs.items()}
8480

8581
logger.info("Running mandatory_tour_scheduling with %d tours", len(tours))
8682
tdd_choices, timetable = vts.vectorize_tour_scheduling(

activitysim/abm/test/configs/mandatory_tour_scheduling.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ LOGSUM_SETTINGS: tour_mode_choice.yaml
2121

2222
SEGMENT_COL: primary_purpose
2323

24+
SPEC:
25+
work: tour_scheduling_work.csv
26+
school: tour_scheduling_school.csv
27+
univ: tour_scheduling_school.csv
2428

2529
#CHOOSER_ORIG_COL_NAME: TAZ
2630

example/configs/mandatory_tour_scheduling.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ SIMULATE_CHOOSER_COLUMNS:
1919

2020
LOGSUM_SETTINGS: tour_mode_choice.yaml
2121

22+
SPEC:
23+
work: tour_scheduling_work.csv
24+
school: tour_scheduling_school.csv
25+
univ: tour_scheduling_school.csv
2226

2327
#CHOOSER_ORIG_COL_NAME: TAZ
2428

0 commit comments

Comments
 (0)