I am trying to setup a "good" EUC custom model for EUC (electric unicycle). Here is my first try:
{
"priority": [
{
"if": "road_class == PRIMARY",
"multiply_by": 0.5
},
{
"if": "road_class == SECONDARY || road_class == RESIDENTIAL",
"multiply_by": 0.7
},
{
"if": "road_class == TERTIARY || road_class == UNCLASSIFIED",
"multiply_by": 0.8
},
{
"if": "road_class == CYCLEWAY",
"multiply_by": 1.0
},
{
"if": "road_class == MOTORWAY || road_class == TRUNK",
"multiply_by": 0.0
},
{
"if": "max_speed > 80",
"multiply_by": 0.2
},
{
"if": "surface == ASPHALT || surface == CONCRETE",
"multiply_by": 1.0
},
{
"if": "surface == GRAVEL || track_type == GRADE3 || smoothness == INTERMEDIATE",
"multiply_by": 0.6
},
{
"if": "surface == DIRT || track_type == GRADE4 || smoothness == BAD",
"multiply_by": 0.3
},
{
"if": "track_type == GRADE5 || smoothness == VERY_BAD",
"multiply_by": 0.1
},
{
"if": "max_slope > 0.2 && (surface == GRAVEL || surface == DIRT || smoothness == BAD) || smoothness == VERY_BAD",
"multiply_by": 0.2
},
{
"if": "road_class == STEPS",
"multiply_by": 0.0
}
],
"speed": [
{
"if": "true",
"limit_to": "20"
},
{
"if": "surface == ASPHALT || surface == CONCRETE",
"limit_to": "25"
},
{
"if": "surface == GRAVEL || track_type == GRADE3",
"limit_to": "18"
},
{
"if": "surface == DIRT || track_type == GRADE4",
"limit_to": "10"
},
{
"if": "track_type == GRADE5 || smoothness == VERY_BAD",
"limit_to": "6"
}
]
}
Result is not satisfying. It makes too much detour:
It should find this:
I don't see any reasons from my criteria (road_class, slope) why it does this detour. Any idea please?
EDIT: the max_speed constraint is the cause. If I put 0.4 instead of 0.2, I get:
Does someone has managed to build a good one?