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

Use estimated travel distances instead of euclidian distance #80

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Hussein-Mahfouz
Copy link
Collaborator

Introduces a new feature to account for detour factors and decay rates when calculating travel distances. These travel distances are used in estimating feasible zones, and in plotting actual vs reported distances. Related to #79

Key changes:

Utility Function Updates:

  • src/acbm/assigning/utils.py: Added _adjust_distance function and updated zones_to_time_matrix to include detour and decay adjustments when calculting travel distance from euclidean distances. To check parameters, see this interactive wolfram alpha plot
  • src/acbm/assigning/feasible_zones_primary.py: Updated get_possible_zones to include detour_factor and decay_rate parameters and adjusted the travel time matrix accordingly.
  • src/acbm/validating/utils.py: Updated calculate_od_distances to include the detour and decay adjustments.

Configuration Updates:

  • config/base.toml: Added detour_factor and decay_rate parameters under the new [feasible_assignment] section.
  • src/acbm/config.py: Introduced FeasibleAssignmentParams class and added it to the Config class.

Script Updates:

  • scripts/3.1_assign_primary_feasible_zones.py: Updated the get_possible_zones function to pass detour_factor and decay_rate to the travel time matrix and filtering functions.
  • scripts/3.3_assign_facility_all.py: Updated the plot_scatter_actual_reported function to use the new parameters when plotting. The distance is calculated from the euclidian distance.
  • scripts/4_validation.py: Added detour_factor and decay_rate parameters to the distance validation plots.

@Hussein-Mahfouz Hussein-Mahfouz linked an issue Dec 13, 2024 that may be closed by this pull request
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checking and validating travel distance assumptions
1 participant