Reset routing properties #453
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.