Skip to content

Commit

Permalink
Merge pull request #804 from camsys/explicitchunk-veh
Browse files Browse the repository at this point in the history
explicit chunking for interaction-simulate components
  • Loading branch information
jpn-- authored Feb 20, 2024
2 parents 7513a1f + 12c04f6 commit 30a1ef8
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 300 deletions.
2 changes: 1 addition & 1 deletion activitysim/abm/models/joint_tour_frequency_composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ def joint_tour_frequency_composition(
alternatives=alt_tdd,
spec=model_spec,
locals_d=constants,
chunk_size=state.settings.chunk_size,
trace_label=trace_label,
trace_choice_name=trace_label,
estimator=estimator,
explicit_chunk_size=0,
)

if estimator:
Expand Down
5 changes: 4 additions & 1 deletion activitysim/abm/models/non_mandatory_tour_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ class NonMandatoryTourFrequencySettings(LogitComponentSettings):
annotate_tours: PreprocessorSettings | None = None
"""Preprocessor settings to annotate tours"""

explicit_chunk: int = 0
"""Number of rows to process in each chunk when explicit chunking is enabled"""


@workflow.step
def non_mandatory_tour_frequency(
Expand Down Expand Up @@ -305,10 +308,10 @@ def non_mandatory_tour_frequency(
spec=segment_spec,
log_alt_losers=log_alt_losers,
locals_d=constants,
chunk_size=state.settings.chunk_size,
trace_label="non_mandatory_tour_frequency.%s" % segment_name,
trace_choice_name="non_mandatory_tour_frequency",
estimator=estimator,
explicit_chunk_size=model_settings.explicit_chunk,
)

if estimator:
Expand Down
5 changes: 4 additions & 1 deletion activitysim/abm/models/school_escorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ class SchoolEscortSettings(BaseLogitComponentSettings):
preprocessor_inbound: PreprocessorSettings | None = None
preprocessor_outbound_cond: PreprocessorSettings | None = None

explicit_chunk: int = 0
"""If > 0, use this chunk size instead of adaptive chunking."""


@workflow.step
def school_escorting(
Expand Down Expand Up @@ -539,10 +542,10 @@ def school_escorting(
spec=model_spec,
log_alt_losers=log_alt_losers,
locals_d=locals_dict,
chunk_size=state.settings.chunk_size,
trace_label=stage_trace_label,
trace_choice_name="school_escorting_" + "stage",
estimator=estimator,
explicit_chunk_size=model_settings.explicit_chunk,
)

if estimator:
Expand Down
5 changes: 4 additions & 1 deletion activitysim/abm/models/vehicle_type_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,10 @@ def iterate_vehicle_type_choice(
spec=model_spec,
log_alt_losers=log_alt_losers,
locals_d=locals_dict,
chunk_size=chunk_size,
trace_label=trace_label,
trace_choice_name="vehicle_type",
estimator=estimator,
explicit_chunk_size=model_settings.explicit_chunk,
)

# otherwise, "simple simulation" should suffice, with a model spec that enumerates
Expand Down Expand Up @@ -583,6 +583,9 @@ class VehicleTypeChoiceSettings(LogitComponentSettings):

FLEET_YEAR: int

explicit_chunk: int = 0
"""If > 0, use this chunk size instead of adaptive chunking."""


@workflow.step
def vehicle_type_choice(
Expand Down
291 changes: 0 additions & 291 deletions activitysim/core/configuration.py

This file was deleted.

Loading

0 comments on commit 30a1ef8

Please sign in to comment.