Skip to content

Conversation

BardyBard
Copy link
Collaborator

@BardyBard BardyBard commented Jun 6, 2025

Added a .reset() method to routingProperties object within the little jar.

The routing properties are now reset right before the output of a method is returned to R. I believe this makes the code more bug proof as values are set back to their defaults between calls, removing the possibility that a property is not reset between function calls. See example where I have to set search type back to depart from even though expanded_tmm doesn't use the property as calling arrival_ttm first would have affected the settings in future expanded_ttm calls.

I have also made the code in routingProperties slightly cleaner by defining constants such as DEFAULT_MAX_SPEED, instead of simply assigning a "magic number" such as 50 in the code. This is purely a stylistic/legibility of code choice and does not affect functionality.

Lastly some of the routingProperty defaults seemed to be outdated compared to the current ones in R5R, for example time_window was by default 60 instead of 10 as set in the current R wrappers, so I updated those values.

@BardyBard BardyBard changed the title Reintialize routing properties Reset routing properties Jun 6, 2025
@rafapereirabr
Copy link
Member

thanks !

@rafapereirabr rafapereirabr merged commit 9689ced into master Jun 6, 2025
9 checks passed
@BardyBard BardyBard deleted the reintialize-routing-properties branch June 23, 2025 19:59
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.

2 participants