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

Fix traversal time parkmode #4338

Merged
merged 10 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 6 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
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def get_to(self, obj):
if obj.HasField(str('type')):
enum = obj.DESCRIPTOR.fields_by_name['type'].enum_type.values_by_number
ret_value = enum[getattr(obj, 'type')].name
if ret_value == 'WAITING':
if ret_value == 'WAITING' or (ret_value == 'PARK' and 'section_bike_park' in obj.id):
return None
return PlaceSerializer(obj.destination).data

Expand All @@ -377,7 +377,7 @@ def get__from(self, obj):
if obj.HasField(str('type')):
enum = obj.DESCRIPTOR.fields_by_name['type'].enum_type.values_by_number
ret_value = enum[getattr(obj, 'type')].name
if ret_value == 'WAITING':
if ret_value == 'WAITING' or (ret_value == 'PARK' and 'section_bike_park' in obj.id):
return None
return PlaceSerializer(obj.origin).data

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,9 +597,13 @@ def _update_fallback_with_bike_mode(
[fallback_sections[-1].street_network.path_items[-1]]
)
fallback_sections[-1].street_network.path_items.pop()
target_section.duration += via_pt_access.access_point.traversal_time
target_section.length += via_pt_access.access_point.length
# update the duration and length of the sections
# the duration and length of the target section is the duration and length of the access point
# the duration and length of the fallback section is the duration and length of the street network minus the duration and length of the access point
target_section.duration = via_pt_access.access_point.traversal_time
target_section.length = via_pt_access.access_point.length
fallback_sections[-1].duration -= via_pt_access.access_point.traversal_time
fallback_sections[-1].length -= via_pt_access.access_point.length
else:
fallback_sections[-1].vias.add().CopyFrom(via_pt_access.access_point)

Expand Down