You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background: I want to make conditional restriction working, e.g. no_left_turn@12:00-18:00, as far as I know, the method is using following preprocess commands:
For now it somehow works: if the first time do osrm-customize with a timestamp at 10:00, the above restriction is inactivated, and then if do osrm-customize with a timestamp at 13:00, then above restriction will become activated.
The problem is: if then we do osrm-customize again with a timestamp at 19:00 the restriction is still activated (should not because 19:00 is not between 12:00-18:00).
I tried to read the source code of related part, this is my understanding:
turn weight stored in .osrm.turn_weight_penalties file, when osrm-customize executed with conditional restriction parameters, it will load .osrm.turn_weight_penalties file and update/overwrite related weight with an max turn weight value (max float or int) if conditional restriction should activate according to passed-in timestamp, and then write it out. So the previous turn weight is lost as long as the restriction become activated once.
My question is: is my understanding correct? If it works by design then how to make conditional restriction switch between activated and inactivated repeatedly with only osrm-customize?
PS: A simple solution maybe:
osrm-cutomized without conditional restriction parameters to make sure no conditional restriction overwrite native turn weight.
backup the .osrm.turn_weight_penalties file
every time do osrm-cutomized again first copy to .osrm.turn_weight_penalties from the backup file
Or is there some better method?
Thanks for reading!
The text was updated successfully, but these errors were encountered:
This should work as expected. Rerunning osrm-customize with a different timestamp should change the restrictions applied. @fubupc are you able to provide reproduction steps for what you are seeing?
Background: I want to make conditional restriction working, e.g.
no_left_turn@12:00-18:00
, as far as I know, the method is using following preprocess commands:For now it somehow works: if the first time do
osrm-customize
with a timestamp at10:00
, the above restriction is inactivated, and then if doosrm-customize
with a timestamp at13:00
, then above restriction will become activated.The problem is: if then we do
osrm-customize
again with a timestamp at19:00
the restriction is still activated (should not because19:00
is not between12:00-18:00
).I tried to read the source code of related part, this is my understanding:
turn weight stored in
.osrm.turn_weight_penalties
file, whenosrm-customize
executed with conditional restriction parameters, it will load.osrm.turn_weight_penalties
file and update/overwrite related weight with an max turn weight value (max float or int) if conditional restriction should activate according to passed-in timestamp, and then write it out. So the previous turn weight is lost as long as the restriction become activated once.My question is: is my understanding correct? If it works by design then how to make conditional restriction switch between activated and inactivated repeatedly with only
osrm-customize
?PS: A simple solution maybe:
osrm-cutomized
without conditional restriction parameters to make sure no conditional restriction overwrite native turn weight..osrm.turn_weight_penalties
fileosrm-cutomized
again first copy to.osrm.turn_weight_penalties
from the backup fileOr is there some better method?
Thanks for reading!
The text was updated successfully, but these errors were encountered: