From 54f91ba6eaaf5bc614bc30fff2955961e05317dc Mon Sep 17 00:00:00 2001 From: Alex Zhou Date: Thu, 11 Jun 2026 14:10:53 +1000 Subject: [PATCH] feat: adding explicit chunking capability in trip scheduling choice model --- activitysim/abm/models/trip_scheduling_choice.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/activitysim/abm/models/trip_scheduling_choice.py b/activitysim/abm/models/trip_scheduling_choice.py index 094b00843c..7f49871b3a 100644 --- a/activitysim/abm/models/trip_scheduling_choice.py +++ b/activitysim/abm/models/trip_scheduling_choice.py @@ -275,7 +275,10 @@ def run_trip_scheduling_choice( choosers, chunk_trace_label, chunk_sizer, - ) in chunk.adaptive_chunked_choosers(state, indirect_tours, trace_label): + ) in chunk.adaptive_chunked_choosers( + state, indirect_tours, trace_label, + explicit_chunk_size=model_settings.explicit_chunk + ): # Sort the choosers and get the schedule alternatives choosers = choosers.sort_index() schedules = generate_schedule_alternatives(choosers).sort_index() @@ -344,6 +347,12 @@ class TripSchedulingChoiceSettings(PydanticReadable, extra="forbid"): SPECIFICATION: str """file name of specification file""" + explicit_chunk: float = 0 + """ + If > 0, use this chunk size instead of adaptive chunking. + If less than 1, use this fraction of the total number of rows. + """ + compute_settings: ComputeSettings = ComputeSettings() """Compute settings for this component."""