properties: compact, self-explanatory, declarative "no-loop", native yaml (?)
very specific to influence only the cost and time calculation:
calcMillis:
time = distance_in_m / speed_in_kmh * 3.6 + delay_in_sec + turn_cost_delay_in_sec
calcWeight:
if (isInfinity(time)) return infinity
weight = (time + distance_in_m * distance_priority) * weight_factor
The first of the list entries matches ("haskell pattern matching") and defines the value.
Defaults are: access=false, speed=0, delay=0, priority=1 (if no encoder default exists). How to include toll cost?
If speed was set => access=true is required. Or maybe access is not required and we use isInfinity(time)
instead?
For LM algo we can only decrease speed, set access to false, only increase priority and priority can be only within [0.1, 10]
.
Current flex branch is only able to use tags as filter and priority as factor (no complicated stuff possible):
https://gist.github.com/karussell/2fa551a9fbe8e970ac5d1e874a04a46f
We should have a look into ANTLR and a DSL like https://github.com/latera/hyaml
Is speed the average speed or the maximum? It is the average_speed.
What about cached EncodedValues like average_speed, access, or priority? If specified => they get overwritten and act as fallback or default.
Currently we are able to parse properties from graph.flag_encoders=car|turn_costs=true
via pipe |
in core. It would be nice if this moves to the profile config too. But then we would need to add jackson and yaml dependencies to core. Or should we implement a simple scripting language like done in v1.ghs that does not use many yaml features?
The big question is if we can really allow full scripting support as even with the security manager there are problems (highlighted from janino compiler author):
These are the "really evil things" that an attacker might do. However actions that are not guarded are: Allocate memory and creating new threads. Luckily, the Thread constructor does some reflection, so thread creation by scripts can be prevented by not allowing new RuntimePermission("accessDeclaredMembers"). Memory allocation can not be guarded,