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
{{ message }}
Repository navigation
Use of expressions in custom model "multiply_by" #2743
But if we change the expression to be "limit_to": "max_speed / 0.9", the "/" operator isn't recognized. If we change it to "Math.sqrt(2)", it isn't recognized either.
Enter the following custom model in hike profile:
{
"distance_influence": 15,
"speed": [{
"if": "true",
"multiply_by": "max_speed / 0.9" // or "Math.sqrt(2)"
}],
"priority": [],
"areas": {}
}
You get a parsing error
The same happens in a local 6.2 deployment
Expected behavior
Use of expressions should be possible in "multiply_by" & "limit_to" statements as described in specs.
Yes, either Math.sqrt should be possible or we should give a better "complex" example :)
But if we change the expression to be "limit_to": "max_speed / 0.9", the "/" operator isn't recognized.
I will make it clear in the docs that there are currently the following limitations for the right-hand side expression:
a single encoded value only
three operations +, * and -
In an early version we allowed more complex things - see #2568. (The reason for these limits is mainly to simplify getting the maximum value which is necessary to improve the speed of non-CH requests.)
which is necessary to improve the speed of non-CH requests
To be more precise, it is necessary to use LM. For A* we don't need this limitation and whether LM is faster than A* depends on the custom model: LM gets slower the more the custom model deviates from the prepared profile.
Yes, the maximum-speed estimation is used to improve A* performance (actually currently only for A*, not LM). For LM we have another limitation that is not needed for A*: We cannot increase speeds / reduce weights.
But with #2756 the A* limitation (we need to be able to determine the maximum speed from the custom model) also applies for LM.
Activity
karussell commentedon Feb 6, 2023
Yes, either Math.sqrt should be possible or we should give a better "complex" example :)
I will make it clear in the docs that there are currently the following limitations for the right-hand side expression:
+,*and-In an early version we allowed more complex things - see #2568. (The reason for these limits is mainly to simplify getting the maximum value which is necessary to improve the speed of non-CH requests.)
easbar commentedon Feb 7, 2023
To be more precise, it is necessary to use LM. For A* we don't need this limitation and whether LM is faster than A* depends on the custom model: LM gets slower the more the custom model deviates from the prepared profile.
karussell commentedon Feb 7, 2023
I think we need the maximum values for A* too. See getMinWeight. (To get a better speed approximation often leading to a better response speed)
easbar commentedon Feb 7, 2023
Yes, the maximum-speed estimation is used to improve A* performance (actually currently only for A*, not LM). For LM we have another limitation that is not needed for A*: We cannot increase speeds / reduce weights.
But with #2756 the A* limitation (we need to be able to determine the maximum speed from the custom model) also applies for LM.
CustomModelParser: more explicit verification of method calls, fixes g…
[RSPS-1174] : Upgrade gh7 (#35)
[RSPS-1546] Upgrade to GH8 (#38)